Closed anilflutter closed 11 months ago
@anilflutter make sure you are not building routes inside ScreenUtilInit scope
But ScreenUtil is the parent widget above the MaterialApp. And GoRouter used with Materialapp as MaterialApp.GoRouter().
ScreenUtilInit( designSize: const Size(430, 932), builder: (BuildContext context, Widget? child) { return MaterialApp.router( debugShowCheckedModeBanner: false, theme: AppTheme.appThemeData(context), builder: EasyLoading.init(), routeInformationProvider: Routes.onRouter.routeInformationProvider, routeInformationParser: Routes.onRouter.routeInformationParser, routerDelegate: Routes.onRouter.routerDelegate, ); }, )
The issue is resolved after moving theme out of screen until scope ScreenUtilInit( designSize: const Size(430, 932), builder: (BuildContext context, Widget? child) { return child!; }, child: const MaterialRoute(), ),
child
After applying your solution, I'm now getting this error
Another exception was thrown: LateInitializationError: Field '_minTextAdapt@3085084504' has not been
initialized.
Using this solution, I am not getting any error and not even warning
ScreenUtilInit( designSize: const Size(430, 932), builder: (BuildContext context, Widget? child) { return child!; }, child: const MaterialRoute(), ),
@abdullah432
Can you share the code where are you getting error?
this package sued with GoRouter then I am getting issue while type on textfield. Keyboard doesn't open .
this issue is occurred if TextEditingController without static or global key without static as below given:
// this code give the error final GlobalKey _formKey = GlobalKey();
final TextEditingController mobileController = TextEditingController();
// solved error after add static, but this is not the good solution static final GlobalKey _formKey = GlobalKey();
static final TextEditingController mobileController = TextEditingController();