Blaise Lukwayi N
Blaise Lukwayi N

Reputation: 327

Getting lateInitializationError: context whenever there I use Screen Util

I get this error when the app builds but there is no error in the IDE, and I Have tried both Constructors for the flutter_screenutil package to no avail.

ScreenUtilInit(
    designSize: Size(360, 690),
    minTextAdapt: true,
    splitScreenMode: true,
    builder: () =>
        MaterialApp(
          builder: (context, widget) {
            ScreenUtil.setContext(context);

            return MediaQuery(
              data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
              child: widget,
            );
          },
      navigatorKey: locator<NavigationService>().navigatorKey,
      home:
      !loading && isLogin ?
      SplashScreen()
          : MyHomePage(),),),);

Upvotes: 0

Views: 611

Answers (1)

Jain
Jain

Reputation: 984

As reported on the GitHub repo of the package flutter_screenutil https://github.com/OpenFlutter/flutter_screenutil/issues/317#issuecomment-1032694269

Upvotes: 1

Related Questions