We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问怎样才能使用呢 我在fontSize后面加了.sp,会报错
appBarTheme: AppBarTheme( backgroundColor: Colors.white, foregroundColor: Color.fromARGB(200, 0, 0, 0), centerTitle: true, titleTextStyle: TextStyle( fontSize: 18.sp, fontWeight: FontWeight.bold, color: Color.fromARGB(200, 0, 0, 0), ), ),
E/flutter (29451): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LateInitializationError: Field '_minTextAdapt@1617084504' has not been initialized. E/flutter (29451): #0 ScreenUtil._minTextAdapt (package:flutter_screenutil/src/screen_util.dart) E/flutter (29451): #1 ScreenUtil.scaleText (package:flutter_screenutil/src/screen_util.dart:224:34) E/flutter (29451): #2 ScreenUtil.setSp (package:flutter_screenutil/src/screen_util.dart:258:65) E/flutter (29451): #3 SizeExtension.sp (package:flutter_screenutil/src/size_extension.dart:24:33) E/flutter (29451): #4 AppTheme.light (package:trade_app/common/styles/theme.dart:40:24) E/flutter (29451): #5 AppTheme.light (package:trade_app/common/styles/theme.dart) E/flutter (29451): #6 main (package:trade_app/main.dart:57:23) E/flutter (29451): <asynchronous suspension>
The text was updated successfully, but these errors were encountered:
AppTheme相关参数的配置是在ScreenUtil初始化之前,无法使用ScreenUtil的相关方法!
Sorry, something went wrong.
是的,的确是初始化之前, 我想是不是可以等ScreenUtils初始化之后,再去配置APPTheme. 不然Theme中设置的字体大小会跟其他的字体大小不一样
复制 lib/common/components/getx_app.dart build方法的相关内容用来替换原来的GetxApp 可以解决掉用顺序的问题
No branches or pull requests
请问怎样才能使用呢
我在fontSize后面加了.sp,会报错
The text was updated successfully, but these errors were encountered: