cachePermission method

Future<void> cachePermission(
  1. String permission
)

Implementation

Future<void> cachePermission(String permission) async {
  if (_box == null || !_inited) {
    console("cachePermission _box is null or _inited is false");
    return;
  }
  if (!_box!.isOpen) {
    console("box is not open");
    return;
  }
  String hiveKey = TencentCloudChatCacheKey.permission.name;

  final currentPermission = getPermission();
  final newPermission = "$currentPermission $permission";
  await _box!.put(hiveKey, newPermission);
}