From f9adc68dbf879fefadeae8e86d1c2983f5a2cc3f Mon Sep 17 00:00:00 2001 From: cyan Date: Thu, 15 Aug 2024 06:48:30 +0000 Subject: [PATCH] make getters less strict --- lib/src/mnemonics/legacy/legacy_seed_lang.dart | 4 ++-- lib/src/mnemonics/polyseed_lang.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/mnemonics/legacy/legacy_seed_lang.dart b/lib/src/mnemonics/legacy/legacy_seed_lang.dart index 9e9acc1..4f8077e 100644 --- a/lib/src/mnemonics/legacy/legacy_seed_lang.dart +++ b/lib/src/mnemonics/legacy/legacy_seed_lang.dart @@ -56,11 +56,11 @@ class LegacySeedLang { /// Get the [LegacySeedLang] by it's name eg. "Deutsch" static LegacySeedLang getByName(String name) => - languages.firstWhere((e) => e.name == name); + languages.firstWhere((e) => e.name.toLowerCase() == name.toLowerCase()); /// Get the [LegacySeedLang] by it's english name eg. "Chinese (Simplified)" static LegacySeedLang getByEnglishName(String englishName) => - languages.firstWhere((e) => e.nameEnglish == englishName); + languages.firstWhere((e) => e.nameEnglish.toLowerCase() == englishName.toLowerCase()); /// Get the [LegacySeedLang] using the words of [phrase] static LegacySeedLang getByPhrase(String phrase) { diff --git a/lib/src/mnemonics/polyseed_lang.dart b/lib/src/mnemonics/polyseed_lang.dart index a539185..92491d7 100644 --- a/lib/src/mnemonics/polyseed_lang.dart +++ b/lib/src/mnemonics/polyseed_lang.dart @@ -56,11 +56,11 @@ class PolyseedLang { /// Get the [PolyseedLang] by it's name eg. "espaƱol" static PolyseedLang getByName(String name) => - languages.firstWhere((e) => e.name == name); + languages.firstWhere((e) => e.name.toLowerCase() == name.toLowerCase()); /// Get the [PolyseedLang] by it's english name eg. "Chinese (Simplified)" static PolyseedLang getByEnglishName(String englishName) => - languages.firstWhere((e) => e.nameEnglish == englishName); + languages.firstWhere((e) => e.nameEnglish.toLowerCase() == englishName.toLowerCase()); /// Get the [PolyseedLang] using the words of [phrase] static PolyseedLang getByPhrase(String phrase) {