This is the code:
class UserProvider with ChangeNotifier {
User? _user;
final AuthMethods _authMethods = AuthMethods();
static User get getUser => **_user!;**
Future<void> refreshUser() async {
User user = await _authMethods.getUserDetails();
_user = user;
notifyListeners();
}
}
I tried to call User but It had to be static so I made it static but now I have an issue with the _user!