findLangByName function

Lang findLangByName(
  1. String name
)

Implementation

Lang findLangByName(String name) {
  switch (name) {
    case "fr":
      _langMap.putIfAbsent("fr", () => _French());
      return _langMap["fr"]!;
    case "ar":
      _langMap.putIfAbsent("ar", () => _Arabic());
      return _langMap["ar"]!;
  }
  _langMap.putIfAbsent("en", () => Lang());
  return _langMap["en"]!;
}