i get the error Unhandled Exception: "dynamic" not found. You need to call "Get.put(dynamic())" or "Get.lazyPut(()=>dynamic())" when i call the authController, below is my code.
if (Get.find<AuthController>().isLoggedIn()) {
//statements
}
my init function
Future init() async {
// Core
final sharedPreferences = await SharedPreferences.getInstance();
Get.lazyPut(() => sharedPreferences);
Get.lazyPut(() => ApiClient(
appBaseUrl: AppConstants.BASE_URL,
));
// Repository
Get.lazyPut(() => AuthRepo(apiClient:Get.find(), sharedPreferences: Get.find()));
// controller
Get.lazyPut(() => AuthController(authRepo: Get.find()));
}
main method
void main() async{
await di.init();
runApp(
child: MyApp(),
),
);
}