diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index 7284615..ec52639 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -51,9 +51,6 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker @override void initState() { - Timer(Duration(milliseconds: 0), () { - NativeUtil.notifyInitSuccess(); - }); ///初始化一些数据 initAsync(); @@ -65,6 +62,10 @@ class _HomePageState extends State with WidgetsBindingObserver, Ticker initAsync() async { try { WidgetsBinding.instance.addObserver(this); + ///渲染完第一帧后调用 + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + NativeUtil.notifyInitSuccess(); + }); String data = BaseSettingModel.setting.tab['data']; try { List list = convert.jsonDecode(data);