alibaba / flutter_boost

FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts
https://github.com/alibaba/flutter_boost
MIT License
6.99k stars 1.23k forks source link

接入之后void main 方法执行三次 #1549

Open Sunyuwumengsheng opened 2 years ago

Sunyuwumengsheng commented 2 years ago

按照教程接入后发现胡执行三次void main() 方法

null 16 版本 Android

Flutter Boost Version Target Platform: Target OS version/browser: Devices:

Logs

add your crash log or something else.

Sunyuwumengsheng commented 2 years ago

发现问题所在,application onCreate 多次执行时 viod main 会调用多次 ,不确定这样会不会有隐患。 状态栏透明不起作用PageVisibilityBinding.instance.addGlobalObserver(AppLifecycleObserver()); CustomFlutterBinding(); await SharedPreferences.getInstance(); if (Platform.isAndroid) { SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); } runApp(MyApp()); 需要在集成FlutterBoostActivity 通过代码设置Activity的状态栏

Sunyuwumengsheng commented 2 years ago

还有个问题,FlutterBoost是否提供了Mathod 扩展,虽然提供了事件订阅和注册但是有时需要获取的返回值,事件订阅就没有办法返回,例如我需要借用原生的Oss图片上传但是我需要获取图片url,但是现在订阅事件满足不了。目前做法时在在注册的回到中调有engine 的插件方法添加自己的插件。是否有更好的方法解决