userProvider top-level property
final
Provides the currently logged in User
.
The user is inferred from the UserToken provided by userTokenProvider and will be updated automatically as changes occur.
Note: If the user is not logged in, this provider will return null
.
If you want to update the user, use userController instead.
If you want to login the user, see userTokenController.
Implementation
final userProvider = StateNotifierProvider<UserProvider, User?>((ref) {
final userDataSource = ref.watch(userDataSourceProvider);
return UserProvider(userDataSource);
});