Skip to content

Commit

Permalink
Merge pull request #4 from MrCyjaneK/cyjan-less-strict-getters
Browse files Browse the repository at this point in the history
make getters less strict
  • Loading branch information
konstantinullrich authored Aug 15, 2024
2 parents df92016 + f9adc68 commit 9438a4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/src/mnemonics/legacy/legacy_seed_lang.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/mnemonics/polyseed_lang.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9438a4d

Please sign in to comment.