fix missing openToVerify

This commit is contained in:
otsmr 2026-07-09 20:55:48 +02:00
parent 48be46cf47
commit 21ca0a9c37
6 changed files with 44 additions and 20 deletions

View file

@ -2822,6 +2822,12 @@ abstract class AppLocalizations {
/// **'Open QR code'** /// **'Open QR code'**
String get openQrCode; String get openQrCode;
/// No description provided for @letFriendScanQrToVerify.
///
/// In en, this message translates to:
/// **'Let a friend scan this QR code to verify you'**
String get letFriendScanQrToVerify;
/// No description provided for @deleteVerificationTitle. /// No description provided for @deleteVerificationTitle.
/// ///
/// In en, this message translates to: /// In en, this message translates to:

View file

@ -1597,6 +1597,10 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get openQrCode => 'QR-Code öffnen'; String get openQrCode => 'QR-Code öffnen';
@override
String get letFriendScanQrToVerify =>
'Lass einen Freund diesen QR-Code scannen, um euch zu verifizieren';
@override @override
String get deleteVerificationTitle => 'Verifizierung löschen?'; String get deleteVerificationTitle => 'Verifizierung löschen?';

View file

@ -1584,6 +1584,10 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get openQrCode => 'Open QR code'; String get openQrCode => 'Open QR code';
@override
String get letFriendScanQrToVerify =>
'Let a friend scan this QR code to verify you';
@override @override
String get deleteVerificationTitle => 'Delete verification?'; String get deleteVerificationTitle => 'Delete verification?';

@ -1 +1 @@
Subproject commit 27b598a151a0122f05670d5d8fb6dcfd5f440127 Subproject commit 0679ccad6e217d00e924ec3963f366e3df9a44b1

View file

@ -18,7 +18,11 @@ class ProfileQrCodeComp extends StatefulWidget {
final double size; final double size;
final bool showAvatar; final bool showAvatar;
static Future<void> showSheet(BuildContext context, {Contact? contact}) { static Future<void> showSheet(
BuildContext context, {
Contact? contact,
bool openToVerify = false,
}) {
return showModalBottomSheet( return showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
@ -46,11 +50,17 @@ class ProfileQrCodeComp extends StatefulWidget {
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
Text( Text(
contact != null openToVerify
? context.lang.letUserScanQrCode( ? (contact != null
getContactDisplayName(contact), ? context.lang.letUserScanQrCode(
) getContactDisplayName(contact),
: context.lang.addContactQrSheetSubtext, )
: context.lang.letFriendScanQrToVerify)
: (contact != null
? context.lang.letUserScanQrCode(
getContactDisplayName(contact),
)
: context.lang.addContactQrSheetSubtext),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: context.color.onSurface.withValues(alpha: 0.6), color: context.color.onSurface.withValues(alpha: 0.6),

View file

@ -30,12 +30,10 @@ class VerificationBadgeInfo extends StatelessWidget {
variant: MyButtonVariant.primaryDense, variant: MyButtonVariant.primaryDense,
onPressed: () => context.push( onPressed: () => context.push(
Routes.cameraQRScanner, Routes.cameraQRScanner,
extra: contact != null extra: {
? { if (contact != null) 'contact': contact,
'contact': contact, 'openToVerify': true,
'openToVerify': true, },
}
: null,
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -56,7 +54,11 @@ class VerificationBadgeInfo extends StatelessWidget {
final openButton = MyButton( final openButton = MyButton(
variant: MyButtonVariant.primaryDense, variant: MyButtonVariant.primaryDense,
onPressed: () => ProfileQrCodeComp.showSheet(context, contact: contact), onPressed: () => ProfileQrCodeComp.showSheet(
context,
contact: contact,
openToVerify: true,
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -93,12 +95,10 @@ class VerificationBadgeInfo extends StatelessWidget {
boldTextColor: primaryColor, boldTextColor: primaryColor,
onTap: () => context.push( onTap: () => context.push(
Routes.cameraQRScanner, Routes.cameraQRScanner,
extra: contact != null extra: {
? { if (contact != null) 'contact': contact,
'contact': contact, 'openToVerify': true,
'openToVerify': true, },
}
: null,
), ),
), ),
if (displayButtons) if (displayButtons)