title: Flutter Login with firebase return ERROR_INVALID_EMAIL
body: <p>I get ERROR_INVALID_EMAIL  when I try to login to firebase  but if I replaced _email and _password with the real email and pass from firebase I get Log In FirebaseUser(Instance of 'PlatformUser')</p>
  
  <pre><code> import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  import 'package:firebase_auth/firebase_auth.dart';
  
  class Login extends StatefulWidget {
    @override
    State&lt;StatefulWidget&gt; createState() {
      // TODO: implement createState
      return LoginState();
    }
  }
  
  class LoginState extends State&lt;Login&gt; {
    final GlobalKey&lt;FormState&gt; formState = GlobalKey&lt;FormState&gt;();
    String _email;
    String _password;
    @override
    Widget build(BuildContext context) {
      // TODO: implement build
      return Scaffold(
        appBar: AppBar(
          title: Text('Login Page'),
          centerTitle: true,
          backgroundColor: Colors.deepOrange,
        ),
        body: ListView(
          children: &lt;Widget&gt;[
            Container(
              padding: EdgeInsets.all(10),
              child: Column(
                children: &lt;Widget&gt;[
                  Form(
                    key: formState,
                    child: Container(
                      child: Column(
                        children: &lt;Widget&gt;[
                          TextFormField(
                            keyboardType: TextInputType.emailAddress,
                            autofocus: false,
                            decoration: InputDecoration(
                              icon: Icon(Icons.email),
                              hintText: 'Enter Your E-mail',
                            ),
                            validator: (val) {
                              if (val.isEmpty) {
                                return 'Please Enter Your E-mail Address';
                              }
                              ;
                            },
                            onSaved: (val) {
                              _email = val;
                            },
                          ),
                          TextFormField(
                            autofocus: false,
                            obscureText: true,
                            decoration: InputDecoration(
                              icon: Icon(Icons.vpn_key),
                              hintText: 'Enter Your Password',
                            ),
                            validator: (val) {
                              if (val.isEmpty) {
                                return 'Enter Your Password';
                              } else if (val.length &lt; 6) {
                                return 'Your Password need to be at least 6 characters';
                              }
                              ;
                            },
                            onSaved: (val) {
                              _password = val;
                            },
                          ),
                          RaisedButton(
                            child: Text('Login'),
                            onPressed: () async {
                              final formdata = formState.currentState;
                              if (formdata.validate()) {
                                final FirebaseAuth _auth = FirebaseAuth.instance;
                                formdata.save();
                                AuthResult result = await _auth.signInWithEmailAndPassword(
                                        email: _email, password: _password)
                                    .catchError((error) =&gt; print(error.code));
                                if (result != null) {
                                  FirebaseUser user = result.user;
                                  if (user != null) {
                                    print('Log In: $user');
                                  }
                                  ;
                                }
                                ;
                              }
                              ;
                            },
                            color: Colors.deepOrange,
                            textColor: Colors.white,
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      );
    }
  }
  
  </code></pre>
  
  <p>i have  updated My question i have provided full code why i'm getting message of invalid email should i remove strings at first or remove _email _password from string </p>