loadILibLocaleData method

Future<void> loadILibLocaleData(
  1. String? locale
)

Implementation

Future<void> loadILibLocaleData(String? locale) async {
  if (!_iLibPrepared) {
    return;
  }

  locale ??= getLocale();

  if (!isValidLocale(locale)) {
    return;
  }

  final String dataPath = getJSDataPath(locale);
  if (!fileList.contains(dataPath)) {
    fileList.add(dataPath);
    try {
      final String loadData = await loadJSwithPath(dataPath);
      evaluate(loadData);
      if (currentLocale != locale) {
        notifyListeners();
      }
    } catch (err) {
      debugPrint('Caught error: $err');
    }
  }
}