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

41 lines
1.4 KiB
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: [
ElevatedButton(
2024-07-25 22:23:45 +02:00
child: Text("Oui"),
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
textStyle:
TextStyle(fontSize: 15, fontWeight: FontWeight.normal)),
onPressed: () {
Navigator.of(context).pop("Yes, Of course!"); // Return value
}),
ElevatedButton(
child: Text("Non"),
2024-07-17 23:39:51 +02:00
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
textStyle:
TextStyle(fontSize: 15, fontWeight: FontWeight.normal)),
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;
});
}
}