diff --git a/covas_mobile/lib/classes/descriptionImage.dart b/covas_mobile/lib/classes/descriptionImage.dart index daed5b8..ccad849 100644 --- a/covas_mobile/lib/classes/descriptionImage.dart +++ b/covas_mobile/lib/classes/descriptionImage.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; import 'events.dart'; +import '../variable/globals.dart' as globals; +import 'package:http/http.dart' as http; +import 'dart:io'; import 'package:shared_preferences/shared_preferences.dart'; @@ -7,6 +10,11 @@ mixin ShowDescImageAdd on State { Future addEvents(var events) async { SharedPreferences prefs = await SharedPreferences.getInstance(); var accessToken = prefs.getString("access_token") ?? ""; + if (accessToken.isNotEmpty) { + var urlGet = Uri.parse("${globals.api}/events"); + var responseGet = await http.get(urlGet, + headers: {HttpHeaders.cookieHeader: 'access_token=${accessToken}'}); + } } void showDescImageAddDialog(BuildContext context, var events) { diff --git a/covas_mobile/lib/pages/DisplayPictureScreen.dart b/covas_mobile/lib/pages/DisplayPictureScreen.dart index dfe6c75..1a51781 100644 --- a/covas_mobile/lib/pages/DisplayPictureScreen.dart +++ b/covas_mobile/lib/pages/DisplayPictureScreen.dart @@ -7,7 +7,6 @@ import 'package:flutter_gemini/flutter_gemini.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:http/http.dart' as http; -import 'dart:io'; import 'dart:convert'; import '../variable/globals.dart' as globals;