Share link content update

master^2^2
haroon amjad 3 hours ago
parent d5ee0faa1e
commit 150f4bf3c7

@ -316,6 +316,7 @@ class _DependentDetailsScreenState extends State<DependentDetailsScreen> {
// Full (unmasked) DOB for the share message - distinct from _formatDob/_formatNationalId
// above, which are for the masked on-screen Key Details display.
String _formatDobForShare() {
return "**/**/****";
DateTime? dob = _parseBirthDate(_contact?.dATEOFBIRTH);
if (dob != null) return DateFormat('dd-MM-yyyy').format(dob);
String raw = _contact?.dATEOFBIRTH?.trim() ?? "";
@ -332,8 +333,9 @@ class _DependentDetailsScreenState extends State<DependentDetailsScreen> {
String nationalIdLine =
(nationalId == null || nationalId.isEmpty)
? LocaleKeys.nationalIdOrIqamaFallback.tr()
: "${LocaleKeys.nationalId.tr()}: ${nationalId.replaceAll('-', '')}";
return "$linkToShare\n\n${LocaleKeys.mazayaInviteInstructions.tr()}";
// : "${LocaleKeys.nationalId.tr()}: ${nationalId.replaceAll('-', '')}";
: "${LocaleKeys.nationalId.tr()}: *****";
return "$linkToShare\n\n${LocaleKeys.mazayaInviteInstructions.tr()}\n\n$nationalIdLine\n${LocaleKeys.dateOfBirth.tr()}: ${_formatDobForShare()}";
}
// Shares the invite text together with the language-appropriate steps PDF from assets.

@ -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,14 +464,16 @@ 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('-', '')}";
return "$linkToShare\n\n${LocaleKeys.mazayaInviteInstructions.tr()}";
// 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)}";
}
// Text-only share (the invite message + link). Kept separate from the guide share below

@ -17,8 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.8.1+300091
#version: 3.9.10+1
#version: 3.8.2+300092
version: 3.9.11+1
environment:
sdk: ^3.7.0

Loading…
Cancel
Save