OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.88k stars 494 forks source link

issue on release mode #348

Closed Refaat2020 closed 2 years ago

Refaat2020 commented 2 years ago

when the app is closed and reopened the App not rendering

BrunoJurkovic commented 2 years ago

@Refaat2020 check #350

huajian123 commented 2 years ago

It is work for me on this way ` void main() { runApp(MyApp()); }

class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key);

@override Widget build(BuildContext context) { return ScreenUtilInit( designSize: Size(360, 690), minTextAdapt: true, splitScreenMode: true, builder: () => GetMaterialApp( debugShowCheckedModeBanner: false, title: "Application", initialRoute: AppPages.INITIAL, getPages: AppPages.routes, //... other code builder: (context, widget) { //add this line ScreenUtil.setContext(context); return MediaQuery( //Setting font does not change with system font size data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), child: widget!, ); }, theme: ThemeData( primaryColor: Colors.red, textTheme: TextTheme( //要支持下面这个需要使用第一种初始化方式 button: TextStyle(fontSize: 45.sp)), ), ), ); } }

`

vekariyasagar commented 2 years ago

It's worked fine as well

Please refer to the below link: [https://github.com/OpenFlutter/flutter_screenutil/issues/350#issuecomment-1074005120]