add reponse http
This commit is contained in:
parent
c44f1e51ea
commit
e320fccefa
@ -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<T extends StatefulWidget> on State<T> {
|
||||
Future<void> 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) {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user