-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
1,326 additions
and
1,466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
enum RestoreType { cryptoWallet, appBackup } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
dynamic getDisplay(dynamic value, String languageCode) { | ||
if (value is! Map<String, dynamic>) return null; | ||
|
||
if (value.isEmpty) return null; | ||
|
||
if (value.containsKey('display')) { | ||
final displays = value['display']; | ||
if (displays is! List<dynamic>) return null; | ||
if (displays.isEmpty) return null; | ||
|
||
final display = displays.firstWhere( | ||
(element) => | ||
element is Map<String, dynamic> && | ||
element.containsKey('locale') && | ||
element['locale'].toString().contains(languageCode), | ||
orElse: () => displays.firstWhere( | ||
(element) => | ||
element is Map<String, dynamic> && | ||
element.containsKey('locale') && | ||
element['locale'].toString().contains('en'), | ||
orElse: () => displays.firstWhere( | ||
(element) => | ||
element is Map<String, dynamic> && element.containsKey('locale'), | ||
orElse: () => null, | ||
), | ||
), | ||
); | ||
|
||
return display; | ||
} else { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.