Describe the bug
在fish_redux框架下集成flutter_boost进行混合开发,flutter页面获取宽高为零
Show the code you wrote as completely as possible.
main.dart
FlutterBoost.singleton.registerPageBuilders({
"vehicle://vehicle_setting_engine_plate_page":(pageName, params,uniqueId) =>
EngineNumberPage().buildPage(Map<String, dynamic>.from(
params..addAll({"uniqueId": uniqueId}))),
});
engine_number_page 的 view.dart
Widget buildView(EngineNumberState state, Dispatch dispatch, ViewService viewService) {
var w = MediaQuery.of(viewService.context).size.width;
}
To Reproduce
1、从原生页面通过flutter_boost跳转flutter页面
2、在view.dart的buildView方法中,通过MediaQuery.of(viewService.context).size.width
3、首次进入页面可以正常获取宽高,第二次进入页面以后获取的宽高均为0
Describe the bug 在fish_redux框架下集成flutter_boost进行混合开发,flutter页面获取宽高为零 Show the code you wrote as completely as possible. main.dart FlutterBoost.singleton.registerPageBuilders({ "vehicle://vehicle_setting_engine_plate_page":(pageName, params,uniqueId) => EngineNumberPage().buildPage(Map<String, dynamic>.from( params..addAll({"uniqueId": uniqueId}))), }); engine_number_page 的 view.dart Widget buildView(EngineNumberState state, Dispatch dispatch, ViewService viewService) { var w = MediaQuery.of(viewService.context).size.width; }
To Reproduce 1、从原生页面通过flutter_boost跳转flutter页面 2、在view.dart的buildView方法中,通过MediaQuery.of(viewService.context).size.width 3、首次进入页面可以正常获取宽高,第二次进入页面以后获取的宽高均为0
Expected behavior 期望每次进入页面都可以通过context正常获取宽高
Additional context