Implemented settings, new scan, enhanced UI/UX
This commit is contained in:
21
lib/feature/authentication/service/userinfo.dart
Normal file
21
lib/feature/authentication/service/userinfo.dart
Normal file
@ -0,0 +1,21 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:hl_lieferservice/feature/authentication/model/user.dart';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
class UserInfoService {
|
||||
String url;
|
||||
|
||||
UserInfoService({ required this.url });
|
||||
|
||||
Future<User> getUserinfo(String sessionId) async {
|
||||
var headers = {
|
||||
"Cookie": "session_id=$sessionId"
|
||||
};
|
||||
|
||||
var result = await get(Uri.parse("$url/userinfo"), headers: headers);
|
||||
debugPrint("USERINFO: ${result.body}");
|
||||
return User.fromJson(jsonDecode(result.body));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user