updateAccountInfo static method

Future<void> updateAccountInfo(
  1. Map<String, dynamic> updateUserData
)

Implementation

static Future<void> updateAccountInfo(Map<String, dynamic> updateUserData) async {
  if (_currentLoginUser.isLoginedUser == false) {
    // not login !!!
    throw HycopUtils.getHycopException(defaultMessage: 'not login !!!');
  }
  await initialize();
  Map<String, dynamic> newUserData = {};
  newUserData.addAll(_currentLoginUser.getValueMap);
  newUserData.addAll(updateUserData);
  await HycopFactory.account!.updateAccountInfo(newUserData).catchError((error, stackTrace) =>
      throw HycopUtils.getHycopException(
          error: error, defaultMessage: 'AccountManager.updateAccount Failed !!!'));
  _currentLoginUser = UserModel(userData: newUserData);
}