Browse Source

1.优化启动页,在宣染完第一帧后再去掉启动屏

tags/0.0.4+3
“yanghuaxuan” 3 years ago
parent
commit
50fdfb49b7
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      lib/pages/home_page/home_page.dart

+ 4
- 3
lib/pages/home_page/home_page.dart View File

@@ -51,9 +51,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker


@override @override
void initState() { void initState() {
Timer(Duration(milliseconds: 0), () {
NativeUtil.notifyInitSuccess();
});


///初始化一些数据 ///初始化一些数据
initAsync(); initAsync();
@@ -65,6 +62,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
initAsync() async { initAsync() async {
try { try {
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
///渲染完第一帧后调用
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
NativeUtil.notifyInitSuccess();
});
String data = BaseSettingModel.setting.tab['data']; String data = BaseSettingModel.setting.tab['data'];
try { try {
List list = convert.jsonDecode(data); List list = convert.jsonDecode(data);


Loading…
Cancel
Save