title: How to sign in with different types of user in flutter and firebase?
body: <p>I am trying to sign in with different types of users, I have firebase authenticator to sign in and made a database with users and userType as a field, so anyone knows a function that shows different interface with different types of user ?
  My Code :</p>
  <pre><code>class _LoginScreenState extends State&lt;LoginScreen&gt; {
    var email;
    var password;
    var username;
    var gender;
    var userType;
    final usernameController = TextEditingController();
    final emailController = TextEditingController();
    final passwordController = TextEditingController();
    final firestoreInstance = Firestore.instance;
        void login() async {
          final FirebaseAuth firebaseAuth = FirebaseAuth.instance;
          firebaseAuth
              .signInWithEmailAndPassword(
                  email: emailController.text, password: passwordController.text)
              .then((result) {
            {
              Navigator.pushReplacementNamed(context, '/homepage');
            }
          }).catchError((err) {
            showDialog(
                context: context,
                builder: (BuildContext context) {
                  return AlertDialog(
                    title: Text(&quot;Error&quot;),
                    content: Text(err.message),
                    actions: [
                      FlatButton(
                        child: Text(&quot;Ok&quot;),
                        onPressed: () {
                          Navigator.of(context).pop();
                        },
                      )
                    ],
                  );
                });
          });
        }
        void getUserData() async {
          try {
            firestoreInstance
                .collection('Users')
                .document(usernameController.text)
                .get()
                .then((value) {
              setState(() {
                email = (value.data)['email'];
                password = (value.data)['password'];
                gender = (value.data)['gender'];
                username = (value.data)['username'];
                userType = (value.data)['userType'];
              });
            });
          } catch (e) {
            print(e.toString);
          }
        }
  </code></pre>