cacheLocale method

Future<void> cacheLocale(
  1. Locale locale
)

Implementation

Future<void> cacheLocale(Locale locale) async {
  if (_box == null || !_inited) {
    console("cacheLocale _box is null or _inited is false");
    return;
  }
  if (!_box!.isOpen) {
    console("box is not open");
    return;
  }
  String hivekey = TencentCloudChatCacheKey.locale.name;
  await _box!.put(hivekey, TencentCloudChatIntl.serializeLocale(locale));
  console("set $hivekey to hive. ${TencentCloudChatIntl.serializeLocale(locale)}");
}