0
I want to display a Snackbar with login error, but I did not find information about it and the way I tried it not working... the login itself works normal, authenticated and all, but I can not pass the error message
This code is part of my login screen, where I get the Mobx-managed authentication status in the API
@override
void didChangeDependencies() {
super.didChangeDependencies();
disposer = reaction((_) => loginState.logado, (logado) {
if (logado = true)
Navigator.of(context)
.pushReplacement(MaterialPageRoute(builder: (_) => Dashboard()));
else if (logado = false)
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
"Não foi possivel realizar o seu login.",
),
));
});
}
This is my login button, also getting information from mobx
Observer(builder: (_) {
return ElevatedButton(
onPressed: loginState.apertouLogin,
child: loginState.carregando
? SizedBox(
height: altura / 40,
width: largura / 20,
child: CircularProgressIndicator(
strokeWidth: largura / 200,
valueColor: AlwaysStoppedAnimation(
Color(0xFFFFFFFF),
),
),
)
: Text(
"LOGIN",
style: TextStyle(),
),
);
}),