Skip to content

Commit

Permalink
use jsonpath to get title of polygon id credential
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Jul 21, 2023
1 parent adcb0ed commit ee513d9
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ class DefaultPolygonIdCardWidget extends StatelessWidget {
}

if (titleDisplayMapping is DisplayMappingPath) {
title = titleDisplayMapping.fallback ?? '';
if (titleDisplayMapping.path.isNotEmpty) {
title = getTextsFromCredential(
titleDisplayMapping.path.first,
credentialModel.data,
).first;
}
if (title == '') {
title = titleDisplayMapping.fallback ?? '';
} else {
final regex = RegExp('(?=[A-Z](?![A-Z]))');
title = title.replaceAll(regex, ' ');
}
}

final DisplayMapping? subTitleDisplayMapping = credentialModel
Expand Down

0 comments on commit ee513d9

Please sign in to comment.