Langaugeset constructor

Langaugeset(
  1. Locale locale,
  2. Map map
)

Implementation

Langaugeset(Locale locale, Map map) {
  bool checkIfString(List<dynamic> list) {
    bool ans = true;
    for (int x = 0; x < list.length; x++) {
      if (list[x].runtimeType.toString() != "String") {
        return !ans;
      }
    }
    return ans;
  }

  if (checkIfString(map.keys.toList()) &&
      checkIfString(map.values.toList())) {
    this.locale = locale;
    this.map = map;
  } else {
    throw ("Map does not meet requirements. Languageset with Locale: ${locale.scriptCode}");
  }
}