-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
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
some text widgets in build mode is missing #558
Comments
I am also having this same issue, did you find a way to resolve this @Akshaykakkodi ? |
try use 5.8.4 |
same problem |
I'm find solution for 5.9.0, it's happens because in release mode when starting app screen width and screen height in ScreenUtil instance was 0 and fontSizeResolver calculate scale font incorrect. My solution:
|
Work for me! Thanks! |
None of the above works for me [✓] Flutter (Channel stable, 3.19.3, on macOS 14.3.1 23D60 darwin-arm64 (Rosetta), locale zh-Hans-CN) In version 5.9.0, Android phones can run with the screen off and wiget will be missing |
@spring321 @hmartiins @mozomig @sagnik-sanyal @Akshaykakkodi Can you try latest version 5.9.2 and see, if problem persist, thanks. Also read #568 |
Tested |
@sahilmind I can't reproduce your problem. Can you provide a reproduction code ? |
@Mounir-Bouaiche I added the screenutil dependency and set the font size to 16.sp. The text is visible in debug mode but not in release mode on the Pixel 6a.
I tried @mozomig's solution, and it works fine. |
@hamiranisahil I can't reproduce your problem. screen-20240531-114022_1080x2400.mp4 |
@Mounir-Bouaiche I can't share the repo now, but I'll create a demo to share. My Mac has Flutter 3.22.0 and Dart 3.4.0, and the app is a release APK. |
@hamiranisahil You can use example from this repo by the way, adjust with your tweaks and push to a new branch. Thanks. |
@Mounir-Bouaiche Sure, I'll adjust it with the necessary tweaks and push it to a new branch. I'll also check the new alpha version with the ScreenUtilSingleton widget. I'll refer to the docs for the alpha version. Thanks! |
I was facing the same issue when using 5.9.2 wih flutter 3.19.0 and above, here is stackoverflow link: I had it working by following the documentation provided in pub.dev for hybrid development: It was working for me until I made changes in my project, and converted it to monorepo, the ThemeData theme() is imported from common package core, and now the issue persists again. /super_app
|
i had same issue my text all despaired after i close and open the release mode |
void main() async { |
@tamremariam I am not sure about that, You might also need to add : even so, I recommend not using after having gone through many issues in production. |
I encountered the same problem. The component disappeared after the application was packaged in a release package. It was traced to the fact that the width and height obtained by screenutil were both 0. |
What is the solution to this problem? |
|
I added ScreenUtil.init(context); and it worked. Why is this? I have already used the ScreenUtilInit component to wrap it, and I still need to do ScreenUtil.init again. |
@CallMeBossC |
I want to know what is the difference between the first and second initialization methods? What is Hybrid development |
When I pass the font size using flutter_screenutil to MaterialApp's theme, I get the same thing as For example: // If you use .h with designSize: Size(430, 932)
ThemeData themeData(BuildContext context) {
final screenHeight = MediaQuery.of(context).size.height;
final scaleHeight = 932 / screenHeight;
return ThemeData(
inputDecorationTheme: InputDecorationTheme(
counterStyle: AppTextStyles.text14Black400,
hintStyle: TextStyle(
fontSize: 14 * scaleHeight,
fontWeight: FontWeight.w400,
),
contentPadding: EdgeInsets.only(
left: 16 * scaleHeight,
right: 16 * scaleHeight,
),
constraints: BoxConstraints(maxHeight: 56 * scaleHeight),
),
);
} Then use MaterialApp in MyAppState/MyApp build. MaterialApp(
// omission
// You can get the screen size by passing `context` in the build.
theme: themeData(context),
// omission
); |
My issue got fixed after adding below code.
|
When building app in release mode some text widgets are missing.
ScreenUtilInit(
designSize: Size(430, 932),
minTextAdapt: true,
splitScreenMode: true,
}
}
The text was updated successfully, but these errors were encountered: