diff --git a/lib/dashboard/ai_age_verification/verify_age/view/ai_age_result_page.dart b/lib/dashboard/ai_age_verification/verify_age/view/ai_age_result_page.dart index 860bed6a2..176a1c37e 100644 --- a/lib/dashboard/ai_age_verification/verify_age/view/ai_age_result_page.dart +++ b/lib/dashboard/ai_age_verification/verify_age/view/ai_age_result_page.dart @@ -204,6 +204,7 @@ class FailureWidget extends StatelessWidget { onPressed: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.pushReplacement( @@ -226,6 +227,7 @@ class FailureWidget extends StatelessWidget { onPressed: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { context diff --git a/lib/dashboard/ai_age_verification/verify_age/view/verify_age_page.dart b/lib/dashboard/ai_age_verification/verify_age/view/verify_age_page.dart index f01bc8f59..24eb219e3 100644 --- a/lib/dashboard/ai_age_verification/verify_age/view/verify_age_page.dart +++ b/lib/dashboard/ai_age_verification/verify_age/view/verify_age_page.dart @@ -81,6 +81,7 @@ class _VerifyAgeViewState extends State { onPressed: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.push( diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/manage_accounts_item.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/manage_accounts_item.dart index e241ae134..82cfcaea9 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/manage_accounts_item.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/manage_accounts_item.dart @@ -139,6 +139,7 @@ class ManageAccountsItem extends StatelessWidget { if (confirm) { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.of(context).push( diff --git a/lib/dashboard/drawer/reset_wallet/view/reset_wallet_menu.dart b/lib/dashboard/drawer/reset_wallet/view/reset_wallet_menu.dart index ea99fee3d..3531b0f7a 100644 --- a/lib/dashboard/drawer/reset_wallet/view/reset_wallet_menu.dart +++ b/lib/dashboard/drawer/reset_wallet/view/reset_wallet_menu.dart @@ -101,6 +101,7 @@ class ResetWalletView extends StatelessWidget { ? () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () async { await resetWallet(context); diff --git a/lib/dashboard/drawer/ssi/manage_did/widgets/did_private_key.dart b/lib/dashboard/drawer/ssi/manage_did/widgets/did_private_key.dart index 2a158807c..175a3b355 100644 --- a/lib/dashboard/drawer/ssi/manage_did/widgets/did_private_key.dart +++ b/lib/dashboard/drawer/ssi/manage_did/widgets/did_private_key.dart @@ -51,6 +51,7 @@ class DidPrivateKey extends StatelessWidget { if (confirm) { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.push(context, route); diff --git a/lib/dashboard/drawer/wallet_security/helper_function/security_check.dart b/lib/dashboard/drawer/wallet_security/helper_function/security_check.dart index 0e6881be0..83da8c3ac 100644 --- a/lib/dashboard/drawer/wallet_security/helper_function/security_check.dart +++ b/lib/dashboard/drawer/wallet_security/helper_function/security_check.dart @@ -7,6 +7,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; Future securityCheck({ required BuildContext context, + required String title, required VoidCallback onSuccess, required LocalAuthApi localAuthApi, }) async { @@ -19,6 +20,7 @@ Future securityCheck({ case WalletProtectionType.FA2: await Navigator.of(context).push( PinCodePage.route( + title: title, isValidCallback: onSuccess.call, restrictToBack: false, walletProtectionType: walletProtectionType, diff --git a/lib/dashboard/drawer/wallet_security/src/view/wallet_security_menu.dart b/lib/dashboard/drawer/wallet_security/src/view/wallet_security_menu.dart index 1fa8698cb..7049abbb8 100644 --- a/lib/dashboard/drawer/wallet_security/src/view/wallet_security_menu.dart +++ b/lib/dashboard/drawer/wallet_security/src/view/wallet_security_menu.dart @@ -50,6 +50,7 @@ class WalletSecurityView extends StatelessWidget { onTap: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.of(context) @@ -78,6 +79,7 @@ class WalletSecurityView extends StatelessWidget { if (confirm) { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.of(context) @@ -102,6 +104,7 @@ class WalletSecurityView extends StatelessWidget { onTap: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.of(context).push( diff --git a/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart b/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart index eb56b2380..2943e0004 100644 --- a/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart +++ b/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_credential_offer/view/polygon_id_credential_offer_view.dart @@ -144,6 +144,7 @@ class PolygonIdCredentialOfferPage extends StatelessWidget { onPressed: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { context.read().addPolygonIdCredentials( diff --git a/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_verification/view/polygon_id_verification_view.dart b/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_verification/view/polygon_id_verification_view.dart index 7a5653fa3..055711afa 100644 --- a/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_verification/view/polygon_id_verification_view.dart +++ b/lib/dashboard/home/tab_bar/credentials/polygon_id/polygon_id_verification/view/polygon_id_verification_view.dart @@ -277,6 +277,7 @@ class _PolygonIdVerificationViewState extends State { ? () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { context diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart index 8c90f5466..bbb4dabce 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/view/credential_manifest_credential_offer_pick_page.dart @@ -349,6 +349,7 @@ class CredentialManifestOfferPickView extends StatelessWidget { bool authenticated = false; await securityCheck( context: context, + title: context.l10n.typeYourPINCodeToShareTheData, localAuthApi: LocalAuthApi(), onSuccess: () { authenticated = true; diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/query_by_example/view/query_by_example_credentials_pick_page.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/query_by_example/view/query_by_example_credentials_pick_page.dart index 46f967819..902cac23d 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/query_by_example/view/query_by_example_credentials_pick_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/query_by_example/view/query_by_example_credentials_pick_page.dart @@ -178,6 +178,8 @@ class QueryByExampleCredentialPickView extends StatelessWidget { bool authenticated = false; await securityCheck( context: context, + title: context.l10n + .typeYourPINCodeToShareTheData, localAuthApi: LocalAuthApi(), onSuccess: () { authenticated = true; diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/selective_disclosure/view/selective_disclosure_pick_page.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/selective_disclosure/view/selective_disclosure_pick_page.dart index 87a9fcf22..ed756175a 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/selective_disclosure/view/selective_disclosure_pick_page.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/selective_disclosure/view/selective_disclosure_pick_page.dart @@ -209,6 +209,7 @@ class _SelectiveDisclosurePickViewState bool authenticated = false; await securityCheck( context: context, + title: context.l10n.typeYourPINCodeToShareTheData, localAuthApi: LocalAuthApi(), onSuccess: () { authenticated = true; diff --git a/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/view/confirm_token_transaction_page.dart b/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/view/confirm_token_transaction_page.dart index 70e56657b..fd7953f10 100644 --- a/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/view/confirm_token_transaction_page.dart +++ b/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/view/confirm_token_transaction_page.dart @@ -266,6 +266,7 @@ class _ConfirmWithdrawalViewState extends State { ? () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { context diff --git a/lib/dashboard/src/view/dashboard_page.dart b/lib/dashboard/src/view/dashboard_page.dart index 09a1f8c5c..d36c45246 100644 --- a/lib/dashboard/src/view/dashboard_page.dart +++ b/lib/dashboard/src/view/dashboard_page.dart @@ -122,6 +122,7 @@ class _DashboardViewState extends State { onButtonClick: () async { await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () => Navigator.of(context) .push(RecoveryKeyPage.route()), diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 517215048..a3d4fa393 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -1155,5 +1155,8 @@ "credentialPickTitle": "Choose the credential(s) to wish to obtain", "credentialShareTitle": "Choose the credential(s) to share", "enterYourSecretCode": "Enter your secret code.", - "jwk": "JWK" + "jwk": "JWK", + "typeYourPINCodeToOpenTheWallet": "Type your PIN code to open the wallet", + "typeYourPINCodeToShareTheData": "Type your PIN code to share the data", + "typeYourPINCodeToAuthenticate": "Type your PIN code to authenticate" } diff --git a/lib/l10n/untranslated.json b/lib/l10n/untranslated.json index 85fe11a97..26c87b9d2 100644 --- a/lib/l10n/untranslated.json +++ b/lib/l10n/untranslated.json @@ -72,7 +72,10 @@ "credentialPickTitle", "credentialShareTitle", "enterYourSecretCode", - "jwk" + "jwk", + "typeYourPINCodeToOpenTheWallet", + "typeYourPINCodeToShareTheData", + "typeYourPINCodeToAuthenticate" ], "es": [ @@ -148,7 +151,10 @@ "credentialPickTitle", "credentialShareTitle", "enterYourSecretCode", - "jwk" + "jwk", + "typeYourPINCodeToOpenTheWallet", + "typeYourPINCodeToShareTheData", + "typeYourPINCodeToAuthenticate" ], "fr": [ @@ -229,6 +235,9 @@ "credentialPickTitle", "credentialShareTitle", "enterYourSecretCode", - "jwk" + "jwk", + "typeYourPINCodeToOpenTheWallet", + "typeYourPINCodeToShareTheData", + "typeYourPINCodeToAuthenticate" ] } diff --git a/lib/pin_code/view/pin_code_page.dart b/lib/pin_code/view/pin_code_page.dart index da5007b91..c0b22aa37 100644 --- a/lib/pin_code/view/pin_code_page.dart +++ b/lib/pin_code/view/pin_code_page.dart @@ -8,24 +8,28 @@ import 'package:secure_storage/secure_storage.dart'; class PinCodePage extends StatelessWidget { const PinCodePage({ super.key, + required this.title, required this.isValidCallback, this.restrictToBack = true, required this.localAuthApi, required this.walletProtectionType, }); + final String title; final VoidCallback isValidCallback; final bool restrictToBack; final LocalAuthApi localAuthApi; final WalletProtectionType walletProtectionType; static Route route({ + required String title, required VoidCallback isValidCallback, required WalletProtectionType walletProtectionType, bool restrictToBack = true, }) => MaterialPageRoute( builder: (_) => PinCodePage( + title: title, isValidCallback: isValidCallback, restrictToBack: restrictToBack, localAuthApi: LocalAuthApi(), @@ -42,6 +46,7 @@ class PinCodePage extends StatelessWidget { secureStorageProvider: getSecureStorage, ), child: PinCodeView( + title: title, isValidCallback: isValidCallback, restrictToBack: restrictToBack, localAuthApi: localAuthApi, @@ -54,12 +59,14 @@ class PinCodePage extends StatelessWidget { class PinCodeView extends StatefulWidget { const PinCodeView({ super.key, + required this.title, required this.isValidCallback, this.restrictToBack = true, required this.localAuthApi, required this.walletProtectionType, }); + final String title; final VoidCallback isValidCallback; final bool restrictToBack; final LocalAuthApi localAuthApi; @@ -85,8 +92,7 @@ class _PinCodeViewState extends State { titleLeading: widget.restrictToBack ? null : const BackLeadingButton(), scrollView: false, body: PinCodeWidget( - title: l10n.enterYourPinCode, - subTitle: l10n.pinCodeMessage, + title: widget.title, deleteButton: Text( l10n.delete, style: Theme.of(context).textTheme.labelLarge, diff --git a/lib/splash/bloclisteners/blocklisteners.dart b/lib/splash/bloclisteners/blocklisteners.dart index f298aa74a..d1728d66f 100644 --- a/lib/splash/bloclisteners/blocklisteners.dart +++ b/lib/splash/bloclisteners/blocklisteners.dart @@ -32,6 +32,7 @@ final splashBlocListener = BlocListener( if (state.status == SplashStatus.routeToPassCode) { securityCheck( context: context, + title: context.l10n.typeYourPINCodeToOpenTheWallet, localAuthApi: LocalAuthApi(), onSuccess: () { Navigator.of(context).push(DashboardPage.route()); @@ -530,6 +531,7 @@ final qrCodeBlocListener = BlocListener( bool authenticated = false; await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { authenticated = true; @@ -844,6 +846,7 @@ final polygonIdBlocListener = BlocListener( await securityCheck( context: context, + title: l10n.typeYourPINCodeToAuthenticate, localAuthApi: LocalAuthApi(), onSuccess: () { context.read().authenticateOrGenerateProof( diff --git a/test/pin_code/view/pin_code_page_test.dart b/test/pin_code/view/pin_code_page_test.dart index 6319d6c05..a8115def2 100644 --- a/test/pin_code/view/pin_code_page_test.dart +++ b/test/pin_code/view/pin_code_page_test.dart @@ -70,6 +70,7 @@ void main() { Navigator.of(context).push( PinCodePage.route( isValidCallback: () {}, + title: '', walletProtectionType: WalletProtectionType.FA2, ), ); @@ -102,6 +103,7 @@ void main() { BlocProvider.value(value: flavorCubit), ], child: PinCodePage( + title: '', isValidCallback: () {}, walletProtectionType: WalletProtectionType.FA2, localAuthApi: localAuthApi,