load method

Future<bool> load([
  1. Map<String, dynamic>? sentences
])

Implementation

Future<bool> load([Map<String, dynamic>? sentences]) async {
  if (sentences != null) {
    _sentences = sentences;
    return true;
  }

  try {
    String data = await rootBundle
        .loadString('resources/lang/${this.locale.languageCode}.json');
    this._sentences = json.decode(data);

    return true;
  } catch (_) {
    return false;
  }
}