Flutter web app progress indicator before loading app?

后端 未结 3 564
清歌不尽
清歌不尽 2021-02-08 22:46

Hi I am a mobile app developer and not much familiar with web development, I was finding any approach to implement Progress Indicator before loading the flutter web app like Gma

3条回答
  •  醉梦人生
    2021-02-08 23:30

    In addition to answer of @Shahzad Akram you should remove the loading div because in Safari browser it may cause of flickering. So in the first screen you need to implement the folowing code (for example, in initState method):

    import 'package:universal_html/html.dart'
    
    ...
    
    @override
    void initState() {
      super.initState()
      // Remove `loading` div
      final loader = document.getElementsByClassName('loading');
      if(loader.isNotEmpty) {
        loader.first.remove();
      }
    }
    

    P.S. For nice loaders you can visit loading.io.

提交回复
热议问题