You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
370 B
19 lines
370 B
|
5 months ago
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
class AuthProvider extends ChangeNotifier {
|
||
|
|
String? _userType; // "Admin" ou "Serveur"
|
||
|
|
|
||
|
|
String? get userType => _userType;
|
||
|
|
bool get isLoggedIn => _userType != null;
|
||
|
|
|
||
|
|
void loginAs(String userType) {
|
||
|
|
_userType = userType;
|
||
|
|
notifyListeners();
|
||
|
|
}
|
||
|
|
|
||
|
|
void logout() {
|
||
|
|
_userType = null;
|
||
|
|
notifyListeners();
|
||
|
|
}
|
||
|
|
}
|