无论是Activity,还是fragment界面首次都会闪一下黑屏
升级 flutter_boost 从 v3.0-preview.18 到 v3.0-null-safety-preview.18支持空安全版本后
Android端出现此问题
IOS端没有问题
1.跳转Activity:public void pushFlutterRoute(FlutterBoostRouteOptions options) { Intent intent = new CommonFlutterActivity.CachedEngineIntentBuilder(CommonFlutterActivity.class) .backgroundMode(FlutterActivityLaunchConfigs.BackgroundMode.opaque) .destroyEngineWithActivity(false) .uniqueId(options.uniqueId()) .url(options.pageName()) .urlParams(options.arguments()) .build(FlutterBoost.instance().currentActivity()); FlutterBoost.instance().currentActivity().startActivityForResult(intent, options.requestCode()); }
2.fragment添加
`val mineFlutterFragment = FlutterBoostFragment.CachedEngineFragmentBuilder(FlutterBoostFragment::class.java)
.url("mine_flutterpage")
.build()
mFragments.append(R.id.minePage, mineFlutterFragment)`
暂无报错信息
2条答案
按热度按时间pdsfdshx1#
运行null-safety 分支最新代码,v3.0-null-safety-preview.18 Android上, 打开flutter页面, flutter fragment没有发现黑屏问题,请在官方Demo上测试看看能不能复现这样的问题
xqkwcwgp2#
@sunsxuan
官方demo非空安全的代码运行正常,空安全的运行到安卓机上就是先白屏,然后就黑屏。