I have the following code which basically handles an error and then the goal is to show a snackbar. However, I am currently stuck at adding async
to the builder function. How can I accomplish this?
return StretchableButton(
buttonColor: Color(0xFF1877F2),
borderRadius: borderRadius,
splashColor: splashColor,
onPressed: () async {
Builder(
builder: (context) async =>
await Provider.of<Auth>(context, listen: false).signInFB(context).catchError((e) {
print('Inside catch error fb');
if(e.code == 'account-exists-with-different-credential')
{
return AlertDialog(
title: Text('You have already used the same email to login'));
}
});
);