'Flutter Getx and ScreenUtility Not Work Together

I have problem with ScreenUtility and GetMaterialApp. When i use GetMaterialApp and ScreenUtility together i got some error. When i build apk release, in first open evertyhing seems normal, but when close apk and open again, my widgets are disappering.

`void main() { WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); runApp(ScreenUtilInit( designSize: const Size(375, 812), builder: () => GetMaterialApp(

  theme: ThemeData(
      textTheme: TextTheme(
        subtitle1: TextStyle(color: Colors.white),
        subtitle2: RegisterPageConstansts.textFieldHintStyle,
      ),
      fontFamily: "Avenir"),
  home: const OnboardingScreen(),
),

)); FlutterNativeSplash.remove(); }`



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source