add events function

This commit is contained in:
Valentin CZERYBA 2024-07-25 22:44:06 +02:00
parent ab297ffc77
commit c44f1e51ea

View File

@ -1,7 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'events.dart'; import 'events.dart';
import 'package:shared_preferences/shared_preferences.dart';
mixin ShowDescImageAdd<T extends StatefulWidget> on State<T> { mixin ShowDescImageAdd<T extends StatefulWidget> on State<T> {
Future<void> addEvents(var events) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var accessToken = prefs.getString("access_token") ?? "";
}
void showDescImageAddDialog(BuildContext context, var events) { void showDescImageAddDialog(BuildContext context, var events) {
// Create AlertDialog // Create AlertDialog
String name = events['name']; String name = events['name'];
@ -17,7 +24,7 @@ mixin ShowDescImageAdd<T extends StatefulWidget> on State<T> {
TextButton( TextButton(
child: Text("Oui"), child: Text("Oui"),
onPressed: () { onPressed: () {
Navigator.of(context).pop("Yes, Of course!"); // Return value addEvents(events); // Return value
}), }),
], ],
); );