getUserData method

Future<Map<String, dynamic>?> getUserData(
  1. String userId, {
  2. bool authDataMustExist = true,
})

Implementation

Future<Map<String, dynamic>?> getUserData(
  String userId, {
  /// this will make sure that the auth data for user exist first before setting the
  /// user data
  bool authDataMustExist = true,
}) async {
  if (authDataMustExist) {
    AuthModel? authModel =
        await _authService.authDbProvider.getUserById(userId);
    if (authModel == null) {
      throw NoUserRegisteredException();
    }
  }
  return userDataDbProvider.getUserData(userId);
}