I am very new to flutter, I already connect the Firebase function with sign in button. It work perfectly, the only thing I wanted to do is to add Error message if the email and password is not found, not registered etc, for example there is no known id inside the firebase of the user account. It will show 'User not found", invalid email or password etc.
Container(
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0),
child: Container(
decoration: BoxDecoration(
color: Colors.grey[500].withOpacity(0.5),
borderRadius: BorderRadius.circular(16)),
child: TextFormField(
onChanged: (value) {
setState(() {
_email = value.trim();
});
},
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 20.0),
border: InputBorder.none,
hintText: 'Email',
hintStyle: TextStyle(
fontSize: 20.0, color: Colors.white),
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: Icon(
FontAwesomeIcons.solidEnvelope,
color: Colors.white,
size: 20.0,
),
),
),
style: TextStyle(
fontSize: 20.0, color: Colors.white),
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
),
),
),
Container(
decoration: BoxDecoration(
color: Colors.grey[500].withOpacity(0.5),
borderRadius: BorderRadius.circular(16)),
child: TextFormField(
onChanged: (value) {
setState(() {
_password = value.trim();
});
},
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 20.0),
border: InputBorder.none,
hintText: 'Password',
hintStyle: TextStyle(
fontSize: 20.0, color: Colors.white),
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0),
child: Icon(
FontAwesomeIcons.lock,
color: Colors.white,
size: 20.0,
),
),
suffixIcon: Icon(
FontAwesomeIcons.eye,
color: Colors.white,
size: 20.0,
)),
obscureText: true,
style:
TextStyle(fontSize: 20.0, color: Colors.white),
keyboardType: TextInputType.name,
textInputAction: TextInputAction.done,
),
),
SizedBox(
height: 20.0,
),
RoundedButton(
text: "Login",
color: Colors.grey[600],
press: () async {
await auth.signInWithEmailAndPassword(
email: _email, password: _password);
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => WelcomeScreen()));
}),
Any help is appreciated. Thank you. im very new to stack overflow too. sorry if my question format wrong