mobile-flutter/covas_mobile/lib/classes/descriptionImage.dart

33 lines
991 B
Dart
Raw Normal View History

2024-07-17 23:39:51 +02:00
import 'package:flutter/material.dart';
2024-07-25 22:23:45 +02:00
import 'events.dart';
2024-07-17 23:39:51 +02:00
mixin ShowDescImageAdd<T extends StatefulWidget> on State<T> {
2024-07-25 22:23:45 +02:00
void showDescImageAddDialog(BuildContext context, var events) {
2024-07-17 23:39:51 +02:00
// Create AlertDialog
2024-07-25 22:23:45 +02:00
String name = events['name'];
2024-07-17 23:39:51 +02:00
AlertDialog dialog = AlertDialog(
2024-07-25 22:23:45 +02:00
title: Text("Ajouter un evenement"),
content: Text("${name} n'a pas été trouvé. Voulez-vous l'ajouter ? "),
2024-07-17 23:39:51 +02:00
actions: [
2024-07-25 22:34:35 +02:00
TextButton(
child: Text("Annuler"),
2024-07-25 22:23:45 +02:00
onPressed: () {
Navigator.of(context).pop("Yes, Of course!"); // Return value
}),
2024-07-25 22:34:35 +02:00
TextButton(
child: Text("Oui"),
2024-07-17 23:39:51 +02:00
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;
});
}
}