I want to show a alert when this button is pressed but this alertdialog is not working. I am using await to add data to firestore and after that i want to display an alert box.
onPressed: () async {
await firestoreInstance
.collection('favs')
.document(snapshot.data['id'])
.setData(
{
'uid': snapshot.data['uid'],
'id': snapshot.data['id'],
'title': snapshot.data['title'],
'description': snapshot.data['description'],
'duration': snapshot.data['duration'],
'members': snapshot.data['members'],
'complexity': snapshot.data['complexity'],
'affordability': snapshot.data['affordability'],
'prequisites': snapshot.data['prequisites'],
'contact': snapshot.data['contact'],
'imageurl': snapshot.data['imageurl'],
},
);
AlertDialog(title: Text('added to favs!'),);
},