Closed cjango closed 2 years ago
这应该不会是库的问题吧 再看一下
只能在 width 和 height 里面使用,fontSize,EdgeInsets.only(left: 16), 这些地方,都没法用计算的属性,完全按照文档来的,很纳闷是怎么回事。
This is also happening with me also, when I remove the 16.sp, 20.h or 20.w then code is working fine.
but this issue occurred when we push new screenB then we got these(Null check operator used on a null value)
type of error, and come back again to the old screenA then there is an issue on the widget which is using this.
只能在 width 和 height 里面使用,fontSize,EdgeInsets.only(left: 16), 这些地方,都没法用计算的属性,完全按照文档来的,很纳闷是怎么回事。
English:
Just use width and height, fontSize,EdgeInsets.only(left: 16), This area,Metrical attributes for the death method,Completely massage archives,It's very good.
So this null operator crash seems to happen to me when I use width .w or .h
Any ideas?
只能在 width 和 height 里面使用,fontSize,EdgeInsets.only(left: 16), 这些地方,都没法用计算的属性,完全按照文档来的,很纳闷是怎么回事。
English:
Just use width and height, fontSize,EdgeInsets.only(left: 16), This area,Metrical attributes for the death method,Completely massage archives,It's very good.
So this null operator crash seems to happen to me when I use width .w or .h
Any ideas?
i used the second way Initialize, and it worked for me by used the global context,hope it can help you
只能在 width 和 height 里面使用,fontSize,EdgeInsets.only(left: 16), 这些地方,都没法用计算的属性,完全按照文档来的,很纳闷是怎么回事。
我采用的第二种初始化方式,使用的全局的context 解决了这个问题,这是我的示例代码
return StyledToast(
locale: const Locale('en', 'US'),
borderRadius: BorderRadius.circular(5.0),
textPadding: const EdgeInsets.symmetric(horizontal: 17.0, vertical: 10.0),
toastPositions: StyledToastPosition.bottom,
dismissOtherOnShow: true,
toastAnimation: StyledToastAnimation.fade,
child: GetMaterialApp(
navigatorKey: Get.key,
debugShowCheckedModeBanner: false,
onGenerateRoute: onGenerateRoute,
home: const SplashPage(),
initialBinding: BindingsBuilder(
() => GetControllerUtil.initGetController(),
),
),
);
SplashPage
@override
Widget build(BuildContext context) {
ScreenUtil.init(Get.key.currentState?.context,
designSize: const Size(1080, 608),
deviceSize: Size(MediaQuery.of(Get.context??context).size.width,
MediaQuery.of(Get.context??context).size.height),
minTextAdapt: true);
return Scaffold(
body: Container(
color: Colors.blueAccent,
alignment: Alignment.center,
child: const Text(
"Welcome ",
style: TextAndColorConfig.textStyle16_ffd0d0d0,
),
),
);
}
This issue also happening to us we needed to initialize screenutil again like this in the Build method of our class
We are using GetX to open navigation
ScreenUtil.init(
context,
designSize: const Size(414, 896),
deviceSize: Size(MediaQuery.of(Get.context ?? context).size.width, MediaQuery.of(Get.context ?? context).size.height),
minTextAdapt: true,
);
try latest version
Hello @cjango @SumeetMourya @jonchui @BIG-BEARC , I have recently publish the new version of the library. Go check it out and if it works fine for you please close this issue, or else drop error log here. Thank you.
The issue persists in newer version. I am using Flutter 3 and flutter_screenutil 5.5.2
The issue comes up after opening and closing BottomSheet
The issue persists in newer version. I am using Flutter 3 and flutter_screenutil 5.5.2
The issue comes up after opening and closing BottomSheet
@junaidlodhi22, If you don't mind, please try with fix-362 branch instead and tell us if it works with you so we can ship a stable version in pub.dev.
dependencies:
flutter_screenutil: ^5.5.3
The issue persists in newer version. I am using Flutter 3 and flutter_screenutil 5.5.2 The issue comes up after opening and closing BottomSheet
@junaidlodhi22, If you don't mind, please try with fix-362 branch instead and tell us if it works with you so we can ship a stable version in pub.dev.
dependencies: flutter_screenutil: git: url: https://github.com/OpenFlutter/flutter_screenutil branch: fix-362
Yes, this is working right now. We will also send this new update in testing and let's see if the Testing department clears it. But So far so good. thanks
Ok @junaidlodhi22 , please let us know whenever your team confirm. Thank you.
只能在 width 和 height 里面使用,fontSize,EdgeInsets.only(left: 16), 这些地方,都没法用计算的属性,完全按照文档来的,很纳闷是怎么回事。
English: Just use width and height, fontSize,EdgeInsets.only(left: 16), This area,Metrical attributes for the death method,Completely massage archives,It's very good. So this null operator crash seems to happen to me when I use width .w or .h Any ideas?
i used the second way Initialize, and it worked for me by used the global context,hope it can help you
只能在 width 和 height 里面使用,fontSize,EdgeInsets.only(left: 16), 这些地方,都没法用计算的属性,完全按照文档来的,很纳闷是怎么回事。
我采用的第二种初始化方式,使用的全局的context 解决了这个问题,这是我的示例代码
return StyledToast( locale: const Locale('en', 'US'), borderRadius: BorderRadius.circular(5.0), textPadding: const EdgeInsets.symmetric(horizontal: 17.0, vertical: 10.0), toastPositions: StyledToastPosition.bottom, dismissOtherOnShow: true, toastAnimation: StyledToastAnimation.fade, child: GetMaterialApp( navigatorKey: Get.key, debugShowCheckedModeBanner: false, onGenerateRoute: onGenerateRoute, home: const SplashPage(), initialBinding: BindingsBuilder( () => GetControllerUtil.initGetController(), ), ), );
SplashPage
@override Widget build(BuildContext context) { ScreenUtil.init(Get.key.currentState?.context, designSize: const Size(1080, 608), deviceSize: Size(MediaQuery.of(Get.context??context).size.width, MediaQuery.of(Get.context??context).size.height), minTextAdapt: true); return Scaffold( body: Container( color: Colors.blueAccent, alignment: Alignment.center, child: const Text( "Welcome ", style: TextAndColorConfig.textStyle16_ffd0d0d0, ), ), ); }
flutter version 3.0 combined with getx to solve the problem。
@ZyElite, branch fix-362 doesn't work for you?!
Ok @junaidlodhi22 , please let us know whenever your team confirm. Thank you.
Yes, the fix is working fine.
@junaidlodhi22 Thank you for your contribution.
style: TextStyle( color: Colors.black, fontSize: 16.sp, ),
报错: _CastError (Null check operator used on a null value)