title: How do I add loading screen in Flutter
body: <p>I am making an app with flutter and I want a loading screen while fetching data from firestore I used to do this in android by <code>setvisibilty</code> .I am new to flutter and I don't know how to do it I saw some questions on stack but they didn't seem to help full</p>
  <p>I want to show the loading screen if <code>firebaseUser</code> is not <code>null</code>,
  this is my <code>initState</code> method</p>
  <pre><code>  void initState() {
      super.initState();
      isRegistered();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Container(
          padding: EdgeInsets.all(32),
          child: Form(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
              children: &lt;Widget&gt;[
                Text(&quot;Login&quot;),
                SizedBox(
                  height: 16,
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceAround,
                  children: &lt;Widget&gt;[
                    Container(
                      width: 50,
                      child: TextFormField(
                        maxLength: 4,
                        keyboardType: TextInputType.number,
                        controller: countryCodeController,
                        decoration: InputDecoration(
                          hintText: '+251',
                        ),
                      ),
                    ),
                    Container(
                      width: 200,
                      child: TextFormField(
                        maxLength: 9,
                        keyboardType: TextInputType.number,
                        controller: phonenumberController,
                        decoration: InputDecoration(
                          hintText: '912345678',
                        ),
                      ),
                    ),
                  ],
                ),
                SizedBox(
                  height: 16,
                ),
                Container(
                  width: double.infinity,
                  child: FlatButton(
                      child: Text('Login'),
                      color: Colors.white,
                      padding: EdgeInsets.all(16),
                      onPressed: () {
                        final phoneNumber = countryCodeController.text.trim() + phonenumberController.text.trim();
                        if(phonenumberController.text.trim().length == 9 || countryCodeController.text.trim().length == 4){
                          loginUser(phoneNumber, context);
                        }else{
                          Fluttertoast.showToast(msg: &quot;wronge input&quot;);
                        }
                      }),
                )
              ],
            ),
          ),
        ),
      );
    }
    void isRegistered() async{
      FirebaseAuth firebaseAuth = FirebaseAuth.instance;
      final FirebaseUser firebaseUser = await firebaseAuth.currentUser();
      final snapShot = await Firestore.instance.collection(&quot;users&quot;).document(
          firebaseUser.uid).get();
      if (firebaseUser != null) {
        if (snapShot.exists) {
          Navigator.pushReplacement(
              context,
              MaterialPageRoute(
                  builder: (context) =&gt; HomePage(
                    firebaseUser: firebaseUser,
                  )));
        }else{
        }
      }
    }
  }
  </code></pre>