From c44f1e51ea1917ec5ebff68fba40bc7317a1f558 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 25 Jul 2024 22:44:06 +0200 Subject: [PATCH] add events function --- covas_mobile/lib/classes/descriptionImage.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/covas_mobile/lib/classes/descriptionImage.dart b/covas_mobile/lib/classes/descriptionImage.dart index b6243d8..daed5b8 100644 --- a/covas_mobile/lib/classes/descriptionImage.dart +++ b/covas_mobile/lib/classes/descriptionImage.dart @@ -1,7 +1,14 @@ import 'package:flutter/material.dart'; import 'events.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + mixin ShowDescImageAdd on State { + Future addEvents(var events) async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + var accessToken = prefs.getString("access_token") ?? ""; + } + void showDescImageAddDialog(BuildContext context, var events) { // Create AlertDialog String name = events['name']; @@ -17,7 +24,7 @@ mixin ShowDescImageAdd on State { TextButton( child: Text("Oui"), onPressed: () { - Navigator.of(context).pop("Yes, Of course!"); // Return value + addEvents(events); // Return value }), ], );