35 lines
1.0 KiB
Dart
Raw Permalink Normal View History

2024-07-30 23:37:21 +02:00
import 'package:flutter/material.dart';
2024-07-30 23:46:15 +02:00
import '../pages/ListItemMenu.dart';
2024-07-30 23:37:21 +02:00
mixin ShowEventDialog<T extends StatefulWidget> on State<T> {
void showEventDialog(BuildContext context, String text) {
// Create AlertDialog
AlertDialog dialog = AlertDialog(
title: Text("Evenement ajoute"),
content: Text(text),
actions: [
ElevatedButton(
child: Text("OK"),
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
textStyle:
TextStyle(fontSize: 15, fontWeight: FontWeight.normal)),
onPressed: () {
2024-07-30 23:46:15 +02:00
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => ListItemMenu())); // Return value
2024-07-30 23:37:21 +02:00
}),
],
);
// Call showDialog function to show dialog.
Future futureValue = showDialog(
context: context,
builder: (BuildContext context) {
return dialog;
});
}
}