import 'package:flutter/material.dart'; import 'events.dart'; mixin ShowDescImageAdd on State { void showDescImageAddDialog(BuildContext context, var events) { // Create AlertDialog String name = events['name']; AlertDialog dialog = AlertDialog( title: Text("Ajouter un evenement"), content: Text("${name} n'a pas été trouvé. Voulez-vous l'ajouter ? "), actions: [ TextButton( child: Text("Annuler"), onPressed: () { Navigator.of(context).pop("Yes, Of course!"); // Return value }), TextButton( child: Text("Oui"), onPressed: () { Navigator.of(context).pop("Yes, Of course!"); // Return value }), ], ); // Call showDialog function to show dialog. Future futureValue = showDialog( context: context, builder: (BuildContext context) { return dialog; }); } }