Run a test application to test authentication using Firebase , Facebook , Google , and Twitter . Once you see finished and see that they work in the test application, pass everything you need to use it in another application but it turns out that in the other application I use it routes
to change the interface,
The problem is that when trying to enter email or password, the screen flashes and it seems that the Login interface is restarted and does not show any errors. The Email and the password are entered with aTextFormField
therefore try to adapt it as follows
test application
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Provider(
auth: Auth(),
child: MaterialApp(
title: 'Flutter Demo',
theme: ThemeData.dark(),
home: MyHomePage(),
),
);
}
}
main application
class Aplicacion extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Provider(
auth: Auth(),
child: MaterialApp(
routes: <String, WidgetBuilder>{
"/Principal": (BuildContext context) => Home(),
"/Registro": (BuildContext context) => Registro(),
"/Inicio de sesión": (BuildContext context) =>InicioSesion(),
"/crear_datos": (BuildContext context) => Crear_datos(),
"/Datos": (BuildContext context) => Datos(null)
},
home: Inicio(),
theme: ThemeData(
primaryColor: Color(0xFF2F008E), accentColor: Color(0xFFDD303)),
),
);
}
}
What I did was add the following line to my main application
Provider(
auth: Auth(),
child: MaterialApp(..
since otherwise when clicking on RaisedButton
it generated an error that it auth
was null or something like that, my RaisedButton
has the following
onPressed: () {
// return InicioSesionPlussUltraPower();
Navigator.pushNamed(context, "/Inicio de sesión");
},
where you enter the email and password data
TextFormField(
// validator: EmailValidator.validate,
decoration: InputDecoration(
labelText: "Email",
border:
new OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
/* hasFloatingPlaceholder: true */),
onSaved: (value) => _email = value,
),
TextFormField(
validator: PasswordValidator.validate,
decoration: InputDecoration(
labelText: "Password",
border:
new OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
/* hasFloatingPlaceholder: true */),
// obscureText: true,
onSaved: (value) => _password = value,
),
Extract the pages or widgets that you created in a variable to prevent them from being recreated with each change, something like this: