|
|
|
|
@ -430,6 +430,7 @@ class MazayaAccessResultScreen extends StatelessWidget {
|
|
|
|
|
// The raw value can come in as the API's "/Date(ms+tz)/" wrapper or a plain ISO datetime string
|
|
|
|
|
// with a time component - either way we only want the date part.
|
|
|
|
|
String _formatDob(String raw) {
|
|
|
|
|
return "**/**/****";
|
|
|
|
|
String s = raw.trim();
|
|
|
|
|
if (s.isEmpty) return "";
|
|
|
|
|
|
|
|
|
|
@ -463,13 +464,15 @@ class MazayaAccessResultScreen extends StatelessWidget {
|
|
|
|
|
// string we couldn't otherwise parse, rather than showing it as-is with the time attached.
|
|
|
|
|
if (s.contains('T')) return s.split('T').first.replaceAll('/', '-');
|
|
|
|
|
if (s.contains(' ')) return s.split(' ').first.replaceAll('/', '-');
|
|
|
|
|
return s.replaceAll('/', '-');
|
|
|
|
|
// return s.replaceAll('/', '-');
|
|
|
|
|
// return "**/**/****";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Same message built for both "Share Download Link" and "Copy Link" - they must always
|
|
|
|
|
// carry identical content, so this is the single source of truth for it.
|
|
|
|
|
String _buildMazayaInviteMessage(String linkToShare, String nationalId, String dateOfBirth) {
|
|
|
|
|
String nationalIdLine = nationalId.trim().isEmpty ? LocaleKeys.nationalIdOrIqamaFallback.tr() : "${LocaleKeys.nationalId.tr()}: ${nationalId.replaceAll('-', '')}";
|
|
|
|
|
// String nationalIdLine = nationalId.trim().isEmpty ? LocaleKeys.nationalIdOrIqamaFallback.tr() : "${LocaleKeys.nationalId.tr()}: ${nationalId.replaceAll('-', '')}";
|
|
|
|
|
String nationalIdLine = nationalId.trim().isEmpty ? LocaleKeys.nationalIdOrIqamaFallback.tr() : "${LocaleKeys.nationalId.tr()}: *****";
|
|
|
|
|
return "$linkToShare\n\n${LocaleKeys.mazayaInviteInstructions.tr()}\n\n$nationalIdLine\n${LocaleKeys.dateOfBirth.tr()}: ${_formatDob(dateOfBirth)}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|