setUserInfo method

Future<void> setUserInfo(
  1. User currentUserInfo
)

set userInfo in currentUser NodeValue in :Local

@param user object @throws :Local not found on StorageException

Implementation

Future<void> setUserInfo(User currentUserInfo) async {
  try {
    _node = await _storageController.get(":Local");

    String currentUserId = await _getCurrentUserId;
    currentUserInfo.userId = currentUserId;
    //store userInfo in userDetails Nodevalue
    NodeValue localNodeValue =
        NodeValueImpl("userDetails", User.convertUserToJson(currentUserInfo));
    await _node!.addOrUpdateValue(localNodeValue);
    await _storageController.update(_node!);
  } on StorageException {
    throw Exception(":Local not found");
  }
}