Open yuyangkk opened 1 year ago
不错 点赞
Android端也出现类似的问题,debug包没有出现,release包必现,从原生页面进入flutter页面,页面渲染不完整,返回原生再进入就可以渲染出来,杀掉app重启,再进入还是会出现flutter页面渲染不出来。
发现了一个问题,可能是我们使用了flutter_screenutil这个工具,在安卓上可能会有问题
请问下Android如何解决这个问题,也是用了flutter_screenutil,改了flutter_boost_app代码也无效果,首次进入必黑屏,需要切换到桌面再回来才可以显示
请问下Android如何解决这个问题,也是用了flutter_screenutil,改了flutter_boost_app代码也无效果,首次进入必黑屏,需要切换到桌面再回来才可以显示
请问您的问题解决了吗,我们也用了flutter_screenutil
ScreenUtils的初始化不要放在flutter_boost外层,放在它的builder里面初始化
MaterialApp(
theme: theme?.getTheme(),
builder: (context, widget) {
ScreenUtil.init(context,
designSize: Size(375, 667), minTextAdapt: true);
return widget;
}
);
请问下Android如何解决这个问题,也是用了flutter_screenutil,改了flutter_boost_app代码也无效果,首次进入必黑屏,需要切换到桌面再回来才可以显示
请问您的问题解决了吗,我们也用了flutter_screenutil
ScreenUtils的初始化不要放在flutter_boost外层,放在它的builder里面初始化
请问下Android如何解决这个问题,也是用了flutter_screenutil,改了flutter_boost_app代码也无效果,首次进入必黑屏,需要切换到桌面再回来才可以显示
ScreenUtils的初始化不要放在flutter_boost外层,放在它的builder里面初始化
ScreenUtils的初始化不要放在flutter_boost外层,放在它的builder里面初始化
MaterialApp( theme: theme?.getTheme(), builder: (context, widget) { ScreenUtil.init(context, designSize: Size(375, 667), minTextAdapt: true); return widget; } );
感谢,亲测有用!
我遇到这个问题是因为FlutterEngine还没有初始化成功,我使用了EasyLocalization,第一个页面是Flutter,就会必现。添加一个原生页面,delay了几秒跳转到Flutter页面几正常。 我在demo中添加了EasyLocalization,然后在onCreate中立马跳转Flutter也是必现
我遇到这个问题是因为FlutterEngine还没有初始化成功,我使用了EasyLocalization,第一个页面是Flutter,就会必现。添加一个原生页面,delay了几秒跳转到Flutter页面几正常。 我在demo中添加了EasyLocalization,然后在onCreate中立马跳转Flutter也是必现
@piupiubiu 是初始化组件嵌套顺序问题,你把boost放到的初始化放到MaterialApp的builder里就可以了
我遇到这个问题是因为FlutterEngine还没有初始化成功,我使用了EasyLocalization,第一个页面是Flutter,就会必现。添加一个原生页面,delay了几秒跳转到Flutter页面几正常。 我在demo中添加了EasyLocalization,然后在onCreate中立马跳转Flutter也是必现
问题
升级Flutter SDK到3.0.5,flutter_boost版本为4.2.2,运行App首个Flutter页面会白屏,需要切换Tab(应该是触发了重新build)后展示正常。 Debug模式下出现的概率比较小,Release模式下几乎是必现。 恳请大佬们给看下
复现步骤
环境信息
Flutter Boost Version 4.2.2 Target Platform: iOS 10+ Target OS version/browser: iOS16.4 Devices: iPhone14 Pro
[✓] Flutter (Channel stable, 3.0.5, on macOS 13.0 22A8380 darwin-arm, locale zh-Hans-CN) • Flutter version 3.0.5 at /Users/gyk/workdeveloper/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (9 months ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at /Users/gyk/Library/Android/sdk • Platform android-33-ext5, build-tools 33.0.2 • ANDROID_HOME = /Users/gyk/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.12.0
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
[✓] VS Code (version 1.77.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.62.0
[✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 13.0 22A8380 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.121
[✓] HTTP Host Availability • All required HTTP hosts are available
• No issues found!
目前的解决方案是
flutter_boost_app.dart
flutter端集成
Widget _materialAppBuilder(Widget home) { return MaterialApp( builder: EasyLoading.init( builder: (context, widget) { return MediaQuery( data: MediaQuery.of(context) .copyWith(textScaleFactor: 1.0, boldText: false), child: widget, ); }, ), routes: Router().getRouters(context), home: Container( child: home, color: Colors.white, ), ); }
@override Widget build(BuildContext context) { return FlutterBoostApp( routeFactory, appBuilder: _materialAppBuilder, ); }
iOS端集成同demo一样