From 50fdfb49b776c1b498887170f896727d31ba6826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Mon, 18 Jan 2021 15:19:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E5=90=AF=E5=8A=A8=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E5=AE=A3=E6=9F=93=E5=AE=8C=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E5=B8=A7=E5=90=8E=E5=86=8D=E5=8E=BB=E6=8E=89=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home_page/home_page.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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);