Skip to content

Commit

Permalink
SD-JWT: display labels with app language, or english, or first found
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Mar 12, 2024
1 parent 9038ff6 commit 112830e
Showing 1 changed file with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,39 @@ class ClaimsData extends StatelessWidget {
if (displays is! List<dynamic>) return Container();
if (displays.isEmpty) return Container();

final display = displays.where((element) {
final displaySelectedLanguage = displays.where((element) {
if (element is Map<String, dynamic> &&
element.containsKey('locale')) {
if (element['locale'].toString().contains(languageCode)) {
return true;
} else if (element['locale'] == 'en-US') {
}
return false;
}
return false;
}).firstOrNull;

final displayEnglish = displays.where((element) {
if (element is Map<String, dynamic> &&
element.containsKey('locale')) {
if (element['locale'].toString().contains('en')) {
return true;
}
return false;
}
return false;
}).firstOrNull;

final displayFirst = displays.where((element) {
if (element is Map<String, dynamic> &&
element.containsKey('locale')) {
return true;
}
return false;
}).firstOrNull;

final display =
displaySelectedLanguage ?? displayEnglish ?? displayFirst;

if (display == null) return Container();

if (credentialSubjectData.isNotEmpty &&
Expand Down

0 comments on commit 112830e

Please sign in to comment.