title: Sign in Method getting called on a null (Firebase) Flutter
body: <p>sometimes, when I attempt to the the sign in process with firebase I get these errors:</p>
  <p>W/DynamiteModule( 8142): Local module descriptor class fo com.google.firebase.auth not found.</p>
  <p>I/FirebaseAuth( 8142): [FirebaseAuth:] Preparing to create service connection to gms implementation</p>
  <p>D/FirebaseAuth( 8142): Notifying id token listeners about user ( skEEmC0dDBW9z73MsfShWX8M1iu1 ).</p>
  <p>I/flutter ( 8142): Error:NoSuchMethodError: The method 'call' was called on null.</p>
  <p>I/flutter ( 8142): Receiver: null</p>
  <p>I/flutter ( 8142): Tried calling: call()</p>
  <p>Especially if I click on the register button the go back to the log in. Can someone explain why do I get this error and how can I fix it:
  Here is the code:</p>
  <pre><code>     class LoginPage extends StatefulWidget{
  
        static const routeName = '/login';
  
         LoginPage({this.onSignedIn});
  
          final VoidCallback onSignedIn;
  
           @override
            State&lt;StatefulWidget&gt; createState() =&gt; new _LoginPageState();
  
                      }
  
            enum FormType {
               login,
              }
  
           class _LoginPageState extends State &lt;LoginPage&gt; {
  
            final formKey = new GlobalKey&lt;FormState&gt;();
  
             String _email,_password;
  
             bool validateAndSave(){
             final form = formKey.currentState;
              if(form.validate()){
              form.save();
              
            return true;
             }
            return false;
            }
  
      void validateAndSubmit() async{
       if(validateAndSave()){
     try{
     await FirebaseAuth.instance.signInWithEmailAndPassword(email: _email, password: _password);
      widget.onSignedIn();
    }catch (e){
    print('Error:$e');
    }
    }
   }
  
     void moveToRegister() {
      Navigator.of(context).pushReplacementNamed(RegisterPage.routeName);
       }
  
      @override
     Widget build(BuildContext context) {
  return Scaffold(
    appBar: new AppBar(
      title:new Text ('',
      style: new TextStyle(color:Colors.white, fontWeight:FontWeight.bold)
    ),
    backgroundColor: Color(0xff04346c),
    ),
    body: Stack (
      children:&lt;Widget&gt;[
        Container(
          decoration: BoxDecoration(
          gradient: LinearGradient(
          colors: [
            Color(0xff04a3b3),
            Color(0xff04a3b3),
            Color(0xff04a3b3),
            Color(0xff04a3b3),
          ]
        )
      ),
    ),
      Center(
        child: Card(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(10.0)
        ),
        child: Container(
          height:350,
          width:350,
          padding: EdgeInsets.all(16.0),
          child: Form(
            key:formKey,
            child: new Column( 
            children: 
            buildInputs() + buildSubmitButtons(),
            )
          )
       )
      )
     )
    ],
    ),
   );
  }
  
  List&lt;Widget&gt; buildInputs(){
  return [
     Image.asset('imageapp/myimage.png',height:50,width: 250,),
     new TextFormField( 
            decoration: new InputDecoration(labelText: 'Email',
            icon: new Icon (Icons.email)
            ),
            onSaved: (value) =&gt; _email = value,
            ),
            new TextFormField(
              decoration: new InputDecoration (labelText: 'Password',
            icon: new Icon (Icons.lock)
            ),
              obscureText: true,
              onSaved: (value) =&gt; _password = value,
            ),
      ];
  }
  
  List&lt;Widget&gt; buildSubmitButtons(){
   return [
    Padding(padding: EdgeInsets.all(3.0)),
    new RaisedButton(
              child: new Text('Login',style: new TextStyle(fontSize:18.0,color: Colors.white),
              ),
              color:  Color(0xff04346c),
              shape: RoundedRectangleBorder(
              borderRadius : new BorderRadius.circular(30.0)
              ),
              onPressed: validateAndSubmit
              ),
              new FlatButton(
                onPressed: moveToRegister, 
                child: new Text('Create an account',style: new TextStyle(fontSize:13.0),)
                )
         ];
      }
      }
  </code></pre>