Skip to content

Commit

Permalink
dev mod is not working well #2823
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Jul 31, 2024
1 parent 309e700 commit eb0eae1
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Credential {
final String issuer;
@JsonKey(fromJson: _fromJsonTranslations)
final List<Translation> description;
@JsonKey(defaultValue: <Translation>[])
@JsonKey(defaultValue: <Translation>[], fromJson: _fromJsonTranslations)
final List<Translation> name;
@JsonKey(defaultValue: '')
final String expirationDate;
Expand Down Expand Up @@ -126,6 +126,9 @@ class Credential {
.map((dynamic e) => Translation.fromJson(e as Map<String, dynamic>))
.toList();
}
if (json is String) {
return [Translation('en', json)];
}
return [Translation.fromJson(json as Map<String, dynamic>)];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class DisplayNameCard extends StatelessWidget {
}

String getName(BuildContext context) {
var nameValue = GetTranslation.getTranslation(
credentialModel.credentialPreview.name,
context.l10n,
);
var nameValue = credentialModel.display?.name ?? '';
if (nameValue == '') {
nameValue = credentialModel.display?.name ?? '';
nameValue = credentialModel.credentialPreview.type.last;
}
if (nameValue == '') {
nameValue = credentialModel.credentialPreview.type.last;
nameValue = GetTranslation.getTranslation(
credentialModel.credentialPreview.name,
context.l10n,
);
}

return nameValue;
Expand Down
Loading

0 comments on commit eb0eae1

Please sign in to comment.