From d449989a6bdb4bfe91ede0a0b169daecd932173f Mon Sep 17 00:00:00 2001 From: hawkbee <49282360+hawkbee1@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:02:39 +0200 Subject: [PATCH 1/5] Hide NFT send button for tezos_ebsi NFT #1840 our special NFT collection is not displayed properly #1841 (#1858) --- lib/app/shared/constants/altme_strings.dart | 11 +- .../tab_bar/nft/view/nft_details_page.dart | 172 ++++++++++++------ .../home/tab_bar/nft/widgets/nft_item.dart | 2 +- 3 files changed, 124 insertions(+), 61 deletions(-) diff --git a/lib/app/shared/constants/altme_strings.dart b/lib/app/shared/constants/altme_strings.dart index 24960aaca..7585f6bc3 100644 --- a/lib/app/shared/constants/altme_strings.dart +++ b/lib/app/shared/constants/altme_strings.dart @@ -30,6 +30,13 @@ class AltMeStrings { // static const int clientIdForID360 = 200; //minter - static const String minterAddress = - '0x240863E65b2ace78eda93334be396FF220f14354'; + static const List minterBurnAddress = [ + '0x240863E65b2ace78eda93334be396FF220f14354', + ]; + + //Don't send address + static const List contractDontSendAddress = [ + 'KT1VuCBGQW4WakHj1PXhFC1G848dKyNy34kB', + 'KT1Wv4dPiswWYj2H9UrSrVNmcMd9w5NtzczG' + ]; } diff --git a/lib/dashboard/home/tab_bar/nft/view/nft_details_page.dart b/lib/dashboard/home/tab_bar/nft/view/nft_details_page.dart index f1d4a1d68..06a99b0dc 100644 --- a/lib/dashboard/home/tab_bar/nft/view/nft_details_page.dart +++ b/lib/dashboard/home/tab_bar/nft/view/nft_details_page.dart @@ -6,7 +6,6 @@ import 'package:altme/wallet/cubit/wallet_cubit.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_html/flutter_html.dart'; -import 'package:matrix/matrix.dart'; class NftDetailsPage extends StatelessWidget { const NftDetailsPage({ @@ -91,7 +90,7 @@ class _NftDetailsViewState extends State { child: CachedImageFromNetwork( widget.nftModel.displayUrl ?? (widget.nftModel.thumbnailUrl ?? ''), - fit: BoxFit.fill, + fit: BoxFit.contain, errorMessage: l10n.nftTooBigToLoad, borderRadius: const BorderRadius.all( Radius.circular(Sizes.largeRadius), @@ -132,62 +131,7 @@ class _NftDetailsViewState extends State { ), ), ), - navigation: (widget.nftModel.isTransferable == false || - widget.nftModel.contractAddress - .equals(AltMeStrings.minterAddress)) - ? widget.nftModel.contractAddress.equals(AltMeStrings.minterAddress) - ? SafeArea( - child: Padding( - padding: const EdgeInsets.all(Sizes.spaceSmall), - child: MyGradientButton( - text: l10n.burn, - onPressed: () async { - final confirmed = await showDialog( - context: context, - builder: (context) => ConfirmDialog( - title: l10n - .wouldYouLikeToConfirmThatYouIntendToBurnThisNFT, - yes: l10n.yes, - no: l10n.no, - showNoButton: true, - ), - ); - if (confirmed ?? false) { - await context - .read() - .burnDefiComplianceToken( - nftModel: widget.nftModel, - ) - .timeout( - const Duration(minutes: 1), - ); - } - }, - ), - ), - ) - : null - : SafeArea( - child: Padding( - padding: const EdgeInsets.all(Sizes.spaceSmall), - child: MyGradientButton( - text: l10n.send, - onPressed: () { - Navigator.of(context).push( - ConfirmTokenTransactionPage.route( - selectedToken: isTezos - ? (widget.nftModel as TezosNftModel).getToken() - : (widget.nftModel as EthereumNftModel) - .getToken(), - withdrawalAddress: '', - amount: 1, - isNFT: true, - ), - ); - }, - ), - ), - ), + navigation: PickButton(l10n: l10n, isTezos: isTezos, widget: widget), ), ); } @@ -413,3 +357,115 @@ class _NftDetailsViewState extends State { ]; } } + +class SendButton extends StatelessWidget { + const SendButton({ + super.key, + required this.l10n, + required this.isTezos, + required this.widget, + }); + + final AppLocalizations l10n; + final bool isTezos; + final NftDetailsView widget; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Padding( + padding: const EdgeInsets.all(Sizes.spaceSmall), + child: MyGradientButton( + text: l10n.send, + onPressed: () { + Navigator.of(context).push( + ConfirmTokenTransactionPage.route( + selectedToken: isTezos + ? (widget.nftModel as TezosNftModel).getToken() + : (widget.nftModel as EthereumNftModel).getToken(), + withdrawalAddress: '', + amount: 1, + isNFT: true, + ), + ); + }, + ), + ), + ); + } +} + +class BurnButton extends StatelessWidget { + const BurnButton({ + super.key, + required this.l10n, + required this.widget, + }); + + final AppLocalizations l10n; + final NftDetailsView widget; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Padding( + padding: const EdgeInsets.all(Sizes.spaceSmall), + child: MyGradientButton( + text: l10n.burn, + onPressed: () async { + final confirmed = await showDialog( + context: context, + builder: (context) => ConfirmDialog( + title: l10n.wouldYouLikeToConfirmThatYouIntendToBurnThisNFT, + yes: l10n.yes, + no: l10n.no, + showNoButton: true, + ), + ); + if (confirmed ?? false) { + await context + .read() + .burnDefiComplianceToken( + nftModel: widget.nftModel, + ) + .timeout( + const Duration(minutes: 1), + ); + } + }, + ), + ), + ); + } +} + +class PickButton extends StatelessWidget { + const PickButton({ + super.key, + required this.l10n, + required this.isTezos, + required this.widget, + }); + + final AppLocalizations l10n; + final bool isTezos; + final NftDetailsView widget; + + @override + Widget build(BuildContext context) { + if (widget.nftModel.isTransferable == false || + AltMeStrings.contractDontSendAddress + .contains(widget.nftModel.contractAddress)) { + return const SizedBox.shrink(); + } + if (AltMeStrings.minterBurnAddress + .contains(widget.nftModel.contractAddress)) { + return BurnButton(l10n: l10n, widget: widget); + } + return SendButton( + l10n: l10n, + isTezos: isTezos, + widget: widget, + ); + } +} diff --git a/lib/dashboard/home/tab_bar/nft/widgets/nft_item.dart b/lib/dashboard/home/tab_bar/nft/widgets/nft_item.dart index c705d37d7..1fcc0e668 100644 --- a/lib/dashboard/home/tab_bar/nft/widgets/nft_item.dart +++ b/lib/dashboard/home/tab_bar/nft/widgets/nft_item.dart @@ -37,7 +37,7 @@ class NftItem extends StatelessWidget { borderRadius: BorderRadius.circular(15), child: CachedImageFromNetwork( assetUrl, - fit: BoxFit.fill, + fit: BoxFit.contain, errorMessage: l10n.nftTooBigToLoad, ), ), From 0f85d5d4fd83d90c32f5b750b2cb6f8743cf830a Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Thu, 31 Aug 2023 11:05:30 +0200 Subject: [PATCH 2/5] version: 1.20.10+257 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index b2c096c70..d8d101798 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: altme description: AltMe Flutter App -version: 1.20.9+256 +version: 1.20.10+257 publish_to: none environment: From 25b82dbf0b511772160ba340e477eb35853aa870 Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Thu, 31 Aug 2023 14:12:46 +0200 Subject: [PATCH 3/5] Flutter version 3.13.2 --- .fvm/fvm_config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 9c81cf752..e341c5be0 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,4 +1,4 @@ { - "flutterSdkVersion": "3.10.6", + "flutterSdkVersion": "3.13.2", "flavors": {} -} +} \ No newline at end of file From a0fa5bb8735619577f66b2d1024aed4fa32ec47c Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Thu, 31 Aug 2023 14:14:05 +0200 Subject: [PATCH 4/5] linter --- .../helper_functions/helper_functions.dart | 2 +- lib/app/shared/widget/base/page.dart | 2 +- .../matrix_chat/matrix_chat_impl.dart | 2 +- lib/credentials/cubit/credentials_cubit.dart | 2 +- .../view/confirm_connection_page.dart | 63 ------------------- .../operation/cubit/operation_cubit.dart | 2 +- .../view/software_license_view.dart | 2 +- .../drawer/ssi/manage_did/manage_did.dart | 4 +- ....dart => did_ed_dsa_private_key_page.dart} | 0 ..._page.dart => manage_did_ed_dsa_page.dart} | 0 .../view/wallet_security_menu.dart | 6 +- .../view/polygon_id_verification_view.dart | 12 +--- .../cubit/credential_manifest_pick_cubit.dart | 2 - ...l_manifest_credential_offer_pick_page.dart | 1 - .../widgets/display_title_widget.dart | 1 - lib/splash/bloclisteners/blocklisteners.dart | 2 - lib/splash/view/splash_page.dart | 3 - .../lib/src/secure_storage.dart | 4 +- 18 files changed, 16 insertions(+), 94 deletions(-) rename lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/{did_edDSA_private_key_page.dart => did_ed_dsa_private_key_page.dart} (100%) rename lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/{manage_did_edDSA_page.dart => manage_did_ed_dsa_page.dart} (100%) diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index 0b7e530e2..c8a56d829 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -330,7 +330,7 @@ String getSignatureType(String circuitId) { return ''; } -String separateUppercaseWords(String input) { +String splitUppercase(String input) { final regex = RegExp('(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'); return input.split(regex).join(' '); } diff --git a/lib/app/shared/widget/base/page.dart b/lib/app/shared/widget/base/page.dart index 1cf6eaa3c..307f1d91c 100644 --- a/lib/app/shared/widget/base/page.dart +++ b/lib/app/shared/widget/base/page.dart @@ -88,7 +88,7 @@ class _BasePageState extends State with WidgetsBindingObserver { case AppLifecycleState.detached: break; - // TODO: Handle this case. + // TODO(all): Handle this case. } } diff --git a/lib/chat_room/matrix_chat/matrix_chat_impl.dart b/lib/chat_room/matrix_chat/matrix_chat_impl.dart index 76eb8ca7f..fcef3dc11 100644 --- a/lib/chat_room/matrix_chat/matrix_chat_impl.dart +++ b/lib/chat_room/matrix_chat/matrix_chat_impl.dart @@ -142,7 +142,7 @@ class MatrixChatImpl extends MatrixChatInterface { try { for (final eventId in eventIds) { if (eventId != null) { - await room.postReceipt(eventId); + await room.setReadMarker(eventId); } } } catch (e, s) { diff --git a/lib/credentials/cubit/credentials_cubit.dart b/lib/credentials/cubit/credentials_cubit.dart index 6b85a7b88..f5f425a2b 100644 --- a/lib/credentials/cubit/credentials_cubit.dart +++ b/lib/credentials/cubit/credentials_cubit.dart @@ -304,7 +304,7 @@ class CredentialsCubit extends Cubit { // TODO(all): Handle this case. break; case CredentialCategory.polygonidCards: - // TODO: Handle this case. + // TODO(all): Handle this case. break; } } diff --git a/lib/dashboard/connection/confirm_connection/view/confirm_connection_page.dart b/lib/dashboard/connection/confirm_connection/view/confirm_connection_page.dart index 7b7f707e2..d63d7e0e7 100644 --- a/lib/dashboard/connection/confirm_connection/view/confirm_connection_page.dart +++ b/lib/dashboard/connection/confirm_connection/view/confirm_connection_page.dart @@ -134,69 +134,6 @@ class ConfirmConnectionView extends StatelessWidget { textAlign: TextAlign.center, ), const SizedBox(height: Sizes.spaceNormal), - // Text( - // walletConnectCubit.state.sessionProposalEvent!.params - // .generatedNamespaces! - // .toString(), - // ), - // ListView.builder( - // itemCount: walletConnectCubit - // .state - // .sessionProposalEvent! - // .params - // .requiredNamespaces - // .length, - // shrinkWrap: true, - // physics: const ScrollPhysics(), - // itemBuilder: (context, i) { - // final key = walletConnectCubit - // .state - // .sessionProposalEvent! - // .params - // .requiredNamespaces - // .keys - // .elementAt(i); - - // final RequiredNamespace ns = walletConnectCubit - // .state - // .sessionProposalEvent! - // .params - // .requiredNamespaces[key]!; - - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Text('$key : '), - // if (ns.chains != null) ...[ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // const Text('Chains'), - // Text(ns.chains!.toString()), - // ], - // ), - // const SizedBox(height: Sizes.spaceSmall), - // ], - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // const Text('Methods'), - // Text(ns.methods.toString()), - // ], - // ), - // const SizedBox(height: Sizes.spaceSmall), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // const Text('Events'), - // Text(ns.events.toString()), - // ], - // ), - // const SizedBox(height: Sizes.spaceSmall), - // ], - // ); - // }, - // ) ], SelectAccount(connectionBridgeType: connectionBridgeType), const SizedBox(height: Sizes.spaceNormal), diff --git a/lib/dashboard/connection/operation/cubit/operation_cubit.dart b/lib/dashboard/connection/operation/cubit/operation_cubit.dart index 5fd6c098b..cc18220c6 100644 --- a/lib/dashboard/connection/operation/cubit/operation_cubit.dart +++ b/lib/dashboard/connection/operation/cubit/operation_cubit.dart @@ -580,7 +580,7 @@ class OperationCubit extends Cubit { final String? gasLimit = operationDetail.gasLimit; final String? fee = operationDetail.fee; - if (operationDetail.kind == Kinds.origination) { + if (operationDetail.kind == OperationKind.origination) { final String balance = operationDetail.amount ?? '0'; final List> code = operationDetail.code!; final dynamic storage = operationDetail.storage; diff --git a/lib/dashboard/drawer/about_altme/sofware_licenses/view/software_license_view.dart b/lib/dashboard/drawer/about_altme/sofware_licenses/view/software_license_view.dart index 9176e77a2..9929cd90c 100644 --- a/lib/dashboard/drawer/about_altme/sofware_licenses/view/software_license_view.dart +++ b/lib/dashboard/drawer/about_altme/sofware_licenses/view/software_license_view.dart @@ -89,7 +89,7 @@ class _SoftwareLicenseViewState extends State { Expanded( child: Text( '${state.licenses[index].title} ' - '(${state.licenses[index].description.length})', + '${state.licenses[index].description.length}', style: Theme.of(context).textTheme.bodyMedium, ), ), diff --git a/lib/dashboard/drawer/ssi/manage_did/manage_did.dart b/lib/dashboard/drawer/ssi/manage_did/manage_did.dart index 96863f7e9..da607f5ee 100644 --- a/lib/dashboard/drawer/ssi/manage_did/manage_did.dart +++ b/lib/dashboard/drawer/ssi/manage_did/manage_did.dart @@ -4,8 +4,8 @@ export 'view/did_ebsi_v2/did_ebsi_v2_private_key_page.dart'; export 'view/did_ebsi_v2/manage_did_ebsi_v2_page.dart'; export 'view/did_ebsi_v3/did_ebsi_v3_private_key_page.dart'; export 'view/did_ebsi_v3/manage_did_ebsi_v3_page.dart'; -export 'view/did_edDSA/did_edDSA_private_key_page.dart'; -export 'view/did_edDSA/manage_did_edDSA_page.dart'; +export 'view/did_edDSA/did_ed_dsa_private_key_page.dart'; +export 'view/did_edDSA/manage_did_ed_dsa_page.dart'; export 'view/did_polygon_id/manage_did_polygon_id_page.dart'; export 'view/did_secp256k1/did_secp256k1_private_key_page.dart'; export 'view/did_secp256k1/manage_did_secp256k1_page.dart'; diff --git a/lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/did_edDSA_private_key_page.dart b/lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/did_ed_dsa_private_key_page.dart similarity index 100% rename from lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/did_edDSA_private_key_page.dart rename to lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/did_ed_dsa_private_key_page.dart diff --git a/lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/manage_did_edDSA_page.dart b/lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/manage_did_ed_dsa_page.dart similarity index 100% rename from lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/manage_did_edDSA_page.dart rename to lib/dashboard/drawer/ssi/manage_did/view/did_edDSA/manage_did_ed_dsa_page.dart diff --git a/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart b/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart index 216b56d32..e12801c4c 100644 --- a/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart +++ b/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart @@ -175,7 +175,8 @@ class WalletSecurityView extends StatelessWidget { await context .read() .setUserConsentForVerifierAccess( - enabled: value); + enabled: value, + ); }, value: state.model.userConsentForVerifierAccess, activeColor: Theme.of(context).colorScheme.primary, @@ -191,7 +192,8 @@ class WalletSecurityView extends StatelessWidget { await context .read() .setUserPINCodeForAuthentication( - enabled: value); + enabled: value, + ); }, value: state.model.userPINCodeForAuthentication, activeColor: Theme.of(context).colorScheme.primary, 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 e48915156..c3ae9f070 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 @@ -203,16 +203,6 @@ class _PolygonIdVerificationViewState extends State { .copyWith(color: const Color(0xffD1CCE3)), ), const SizedBox(height: 10), - // Text( - // 'Allowed issuers: ${proofScopeRequest.query.allowedIssuers}', - // textAlign: TextAlign.center, - // ), - // const SizedBox(height: 10), - // Text( - // 'Proof type: $proofTypeMsg', - // textAlign: TextAlign.start, - // ), - // const SizedBox(height: 10), Divider(color: Colors.grey.withOpacity(0.25)), if (state.claimEntities!.isNotEmpty && state.claimEntities![index] == null) ...[ @@ -246,7 +236,7 @@ class _PolygonIdVerificationViewState extends State { children: [ Expanded( child: Text( - '${l10n.from} ${separateUppercaseWords( + '${l10n.from} ${splitUppercase( proofScopeRequest.query.type!, )}', textAlign: TextAlign.start, diff --git a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/cubit/credential_manifest_pick_cubit.dart b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/cubit/credential_manifest_pick_cubit.dart index a9ca82bbb..93c882470 100644 --- a/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/cubit/credential_manifest_pick_cubit.dart +++ b/lib/dashboard/home/tab_bar/credentials/present/pick/credential_manifest/cubit/credential_manifest_pick_cubit.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'package:altme/app/shared/shared.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:credential_manifest/credential_manifest.dart'; 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 7aa72fccc..96204da14 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 @@ -5,7 +5,6 @@ import 'package:altme/l10n/l10n.dart'; import 'package:altme/pin_code/pin_code.dart'; import 'package:altme/scan/cubit/scan_cubit.dart'; import 'package:altme/theme/theme.dart'; -import 'package:altme/wallet/wallet.dart'; import 'package:credential_manifest/credential_manifest.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/dashboard/home/tab_bar/credentials/widgets/display_title_widget.dart b/lib/dashboard/home/tab_bar/credentials/widgets/display_title_widget.dart index 5d099a2a5..b71b2e951 100644 --- a/lib/dashboard/home/tab_bar/credentials/widgets/display_title_widget.dart +++ b/lib/dashboard/home/tab_bar/credentials/widgets/display_title_widget.dart @@ -1,6 +1,5 @@ import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; -import 'package:altme/theme/app_theme/app_theme.dart'; import 'package:credential_manifest/credential_manifest.dart'; import 'package:flutter/material.dart'; diff --git a/lib/splash/bloclisteners/blocklisteners.dart b/lib/splash/bloclisteners/blocklisteners.dart index 90a7a22a5..3c376d8a9 100644 --- a/lib/splash/bloclisteners/blocklisteners.dart +++ b/lib/splash/bloclisteners/blocklisteners.dart @@ -5,7 +5,6 @@ import 'package:altme/connection_bridge/connection_bridge.dart'; import 'package:altme/credentials/cubit/credentials_cubit.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; -import 'package:altme/oidc4vc/oidc4vc.dart'; import 'package:altme/onboarding/cubit/onboarding_cubit.dart'; import 'package:altme/onboarding/onboarding.dart'; import 'package:altme/pin_code/pin_code.dart'; @@ -19,7 +18,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:jwt_decode/jwt_decode.dart'; import 'package:polygonid/polygonid.dart'; final splashBlocListener = BlocListener( diff --git a/lib/splash/view/splash_page.dart b/lib/splash/view/splash_page.dart index eadf751cb..2de49e08e 100644 --- a/lib/splash/view/splash_page.dart +++ b/lib/splash/view/splash_page.dart @@ -3,15 +3,12 @@ import 'dart:convert'; import 'package:altme/app/app.dart'; import 'package:altme/connection_bridge/connection_bridge.dart'; -import 'package:altme/credentials/cubit/credentials_cubit.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/deep_link/deep_link.dart'; import 'package:altme/l10n/l10n.dart'; -import 'package:altme/oidc4vc/initiate_oidv4vc_credential_issuance.dart'; import 'package:altme/polygon_id/polygon_id.dart'; import 'package:altme/splash/splash.dart'; import 'package:altme/theme/app_theme/app_theme.dart'; -import 'package:did_kit/did_kit.dart'; import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; diff --git a/packages/secure_storage/lib/src/secure_storage.dart b/packages/secure_storage/lib/src/secure_storage.dart index 137f65017..7b7e11464 100644 --- a/packages/secure_storage/lib/src/secure_storage.dart +++ b/packages/secure_storage/lib/src/secure_storage.dart @@ -45,6 +45,7 @@ Future get initSecureStorage async { /// proper phone secure storage. Future testStorage(FlutterSecureStorage storage) async { final secureStorage = SecureStorageProvider(storage: storage); + // ignore: unused_local_variable final testCompatibility = await secureStorage.getAllValues(); } @@ -59,7 +60,8 @@ class SecureStorageProvider { return _instance; } else { if (_instance._storage == null) { - //TODO: Explain user and give him possibility to send issue report? + // TODO(all): Explain user and give him + // possibility to send issue report? throw Exception('Secure Storage issue with this device'); } return _instance; From 1dac209debe82014407b33eb7348250347d32040 Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Thu, 31 Aug 2023 16:50:01 +0200 Subject: [PATCH 5/5] linter --- lib/app/shared/constants/urls.dart | 3 -- .../response_string/response_string.dart | 2 +- .../response_string_extension.dart | 2 +- .../helper_functions/helper_functions.dart | 1 - .../message_handler/response_message.dart | 4 +- lib/app/shared/widget/base/page.dart | 1 + .../view/wallet_security_menu.dart | 2 +- .../cubit/qr_code_scan_cubit.dart | 2 +- lib/l10n/arb/app_en.arb | 6 +-- lib/l10n/arb/app_fr.arb | 2 +- lib/l10n/untranslated.json | 6 +-- .../view/activate_biometrics_page.dart | 4 +- lib/scan/cubit/scan_cubit.dart | 2 +- packages/oidc4vc/lib/src/oidc4vc.dart | 3 +- .../issuer_token_parameters_class.dart | 11 ------ packages/oidc4vc/test/src/oidc4vc_test.dart | 1 + .../token_parameters_test.dart | 2 + packages/polygonid/lib/src/polygonid.dart | 2 + pubspec.lock | 38 +++++++++++-------- 19 files changed, 47 insertions(+), 47 deletions(-) diff --git a/lib/app/shared/constants/urls.dart b/lib/app/shared/constants/urls.dart index ab0cba5b1..e4f4ab8ed 100644 --- a/lib/app/shared/constants/urls.dart +++ b/lib/app/shared/constants/urls.dart @@ -3,7 +3,6 @@ class Urls { static const String checkIssuerTalaoUrl = 'https://talao.co/trusted-issuers-registry/v1/issuers'; - // TODO(all): update the issuer url for polygon static const String checkIssuerPolygonTestnetUrl = 'https://issuer-demo.polygonid.me/'; static const String checkIssuerPolygonUrl = 'checkIssuerPolygonUrl'; @@ -91,7 +90,6 @@ class Urls { static const objktUrl = 'https://objkt.com/'; static const raribleUrl = 'https://rarible.com/'; - // TODO(all): remember to update all below urls. static const String bunnyPassCardUrl = 'https://issuer.tezotopia.altme.io'; static const String dogamiPassCardUrl = 'https://issuer.tezotopia.altme.io'; static const String matterlightPassCardUrl = @@ -99,7 +97,6 @@ class Urls { static const String pigsPassCardUrl = 'https://issuer.tezotopia.altme.io'; static const String trooperzPassCardUrl = 'https://issuer.tezotopia.altme.io'; - // static const over13AIValidationUrl = 'https://issuer.talao.co/ai/over13'; static const over15AIValidationUrl = 'https://issuer.talao.co/ai/over15'; static const over18AIValidationUrl = 'https://issuer.talao.co/ai/over18'; diff --git a/lib/app/shared/enum/message/response_string/response_string.dart b/lib/app/shared/enum/message/response_string/response_string.dart index d8d456f42..97c8bf8c8 100644 --- a/lib/app/shared/enum/message/response_string/response_string.dart +++ b/lib/app/shared/enum/message/response_string/response_string.dart @@ -148,7 +148,7 @@ enum ResponseString { RESPONSE_STRING_successfullyGeneratingProof, RESPONSE_STRING_pleaseAddXtoConnectToTheDapp, RESPONSE_STRING_pleaseSwitchPolygonNetwork, - RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile, + RESPONSE_STRING_pleaseSwitchToRightOIDC4VCProfile, RESPONSE_STRING_authenticationSuccess, RESPONSE_STRING_youcanSelectOnlyXCredential, } diff --git a/lib/app/shared/enum/message/response_string/response_string_extension.dart b/lib/app/shared/enum/message/response_string/response_string_extension.dart index 0c6db1b43..dc47f95b9 100644 --- a/lib/app/shared/enum/message/response_string/response_string_extension.dart +++ b/lib/app/shared/enum/message/response_string/response_string_extension.dart @@ -466,7 +466,7 @@ extension ResponseStringX on ResponseString { injectedMessage ?? '', ); - case ResponseString.RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile: + case ResponseString.RESPONSE_STRING_pleaseSwitchToRightOIDC4VCProfile: return globalMessage .RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile; diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index c8a56d829..449563f9c 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -221,7 +221,6 @@ Future getStoragePermission() async { if (await Permission.storage.request().isGranted) { return true; } else if (await Permission.storage.request().isPermanentlyDenied) { - // TODO(all): show dialog to choose this option await openAppSettings(); } else if (await Permission.storage.request().isDenied) { return false; diff --git a/lib/app/shared/message_handler/response_message.dart b/lib/app/shared/message_handler/response_message.dart index 6f2606ac0..ba6e0bb0e 100644 --- a/lib/app/shared/message_handler/response_message.dart +++ b/lib/app/shared/message_handler/response_message.dart @@ -689,9 +689,9 @@ class ResponseMessage with MessageHandler { injectedMessage: injectedMessage, ); - case ResponseString.RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile: + case ResponseString.RESPONSE_STRING_pleaseSwitchToRightOIDC4VCProfile: return ResponseString - .RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile.localise( + .RESPONSE_STRING_pleaseSwitchToRightOIDC4VCProfile.localise( context, ); diff --git a/lib/app/shared/widget/base/page.dart b/lib/app/shared/widget/base/page.dart index 307f1d91c..430d6c487 100644 --- a/lib/app/shared/widget/base/page.dart +++ b/lib/app/shared/widget/base/page.dart @@ -86,6 +86,7 @@ class _BasePageState extends State with WidgetsBindingObserver { secureApplicationController.lock(); } + case AppLifecycleState.hidden: case AppLifecycleState.detached: break; // TODO(all): Handle this case. diff --git a/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart b/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart index e12801c4c..d1e2d4e23 100644 --- a/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart +++ b/lib/dashboard/drawer/wallet_security/wallet_security/view/wallet_security_menu.dart @@ -125,7 +125,7 @@ class WalletSecurityView extends StatelessWidget { builder: (context) => ConfirmDialog( title: l10n.biometricsNotSupported, subtitle: l10n - .yourDeviceDoseNotSupportBiometricsAuthentication, // ignore: lines_longer_than_80_chars + .deviceDoNotSupportBiometricsAuthentication, // ignore: lines_longer_than_80_chars yes: l10n.ok, ), ); diff --git a/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart b/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart index 978428c6e..483d47667 100644 --- a/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart +++ b/lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart @@ -194,7 +194,7 @@ class QRCodeScanCubit extends Cubit { message: StateMessage.error( messageHandler: ResponseMessage( ResponseString - .RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile, + .RESPONSE_STRING_pleaseSwitchToRightOIDC4VCProfile, ), showDialog: false, duration: const Duration(seconds: 20), diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 5990b441f..d041c4a12 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -316,7 +316,7 @@ "yourPinCodeChangedSuccessfully": "Your pin code changed successfully", "advantagesCards": "Advantages cards", "advantagesDiscoverCards": "Unlock exclusive rewards", - "identityCards": "Identity cards", + "identityCards": "Identity cards", "identityDiscoverCards": "Simplify ID verification", "contactInfoCredentials": "Contact information", "contactInfoDiscoverCredentials": "Verify your contact information", @@ -353,7 +353,7 @@ "termsOfUse": "Terms of Use & Confidentiality", "scanFingerprintToAuthenticate": "Scan Fingerprint to Authenticate", "biometricsNotSupported": "Biometrics not supported", - "yourDeviceDoseNotSupportBiometricsAuthentication": "Your device dose not supports biometrics authentication", + "deviceDoNotSupportBiometricsAuthentication": "Your device dose not supports biometrics authentication", "biometricsEnabledMessage": "You can now unlock app with your biometrics.", "biometricsDisabledMessage": "Your biometrics has been disabled.", "exportSecretKey": "Export secret key", @@ -560,7 +560,7 @@ "advantagesCredentialHomeSubtitle": "Benefit from exclusive advantages in Web3", "advantagesCredentialDiscoverSubtitle": "Discover loyalty cards and exclusive passes", "identityCredentialHomeSubtitle": "Prove things about yourself while protecting your data", - "identityCredentialDiscoverSubtitle": "Get reusable KYC and age verification credentials", + "identityCredentialDiscoverSubtitle": "Get reusable KYC and age verification credentials", "myProfessionalCredentialDiscoverSubtitle": "Use your professional cards securely", "blockchainAccountsCredentialHomeSubtitle": "Prove your blockchain accounts ownership", "educationCredentialHomeSubtitle": "Prove your education background instantly", diff --git a/lib/l10n/arb/app_fr.arb b/lib/l10n/arb/app_fr.arb index 70aa76ec4..a51e8ce91 100644 --- a/lib/l10n/arb/app_fr.arb +++ b/lib/l10n/arb/app_fr.arb @@ -347,7 +347,7 @@ "termsOfUse": "Conditions d'utilisation et confidentialité", "scanFingerprintToAuthenticate": "Scanner l'empreinte digitale pour s'authentifier", "biometricsNotSupported": "La biométrie n'est pas prise en charge", - "yourDeviceDoseNotSupportBiometricsAuthentication": "Votre appareil ne prend pas en charge l'authentification biométrique", + "deviceDoNotSupportBiometricsAuthentication": "Votre appareil ne prend pas en charge l'authentification biométrique", "biometricsEnabledMessage": "Vous pouvez maintenant déverrouiller l'application avec vos données biométriques.", "biometricsDisabledMessage": "Votre biométrie a été désactivée.", "exportSecretKey": "Exporter la clé secrète", diff --git a/lib/l10n/untranslated.json b/lib/l10n/untranslated.json index 4dd5b41d7..eefd973f3 100644 --- a/lib/l10n/untranslated.json +++ b/lib/l10n/untranslated.json @@ -303,7 +303,7 @@ "termsOfUse", "scanFingerprintToAuthenticate", "biometricsNotSupported", - "yourDeviceDoseNotSupportBiometricsAuthentication", + "deviceDoNotSupportBiometricsAuthentication", "biometricsEnabledMessage", "biometricsDisabledMessage", "exportSecretKey", @@ -1154,7 +1154,7 @@ "termsOfUse", "scanFingerprintToAuthenticate", "biometricsNotSupported", - "yourDeviceDoseNotSupportBiometricsAuthentication", + "deviceDoNotSupportBiometricsAuthentication", "biometricsEnabledMessage", "biometricsDisabledMessage", "exportSecretKey", @@ -2159,7 +2159,7 @@ "termsOfUse", "scanFingerprintToAuthenticate", "biometricsNotSupported", - "yourDeviceDoseNotSupportBiometricsAuthentication", + "deviceDoNotSupportBiometricsAuthentication", "biometricsEnabledMessage", "biometricsDisabledMessage", "exportSecretKey", diff --git a/lib/onboarding/activate_biometircs/view/activate_biometrics_page.dart b/lib/onboarding/activate_biometircs/view/activate_biometrics_page.dart index 66b87e3e2..364eae6a7 100644 --- a/lib/onboarding/activate_biometircs/view/activate_biometrics_page.dart +++ b/lib/onboarding/activate_biometircs/view/activate_biometrics_page.dart @@ -156,8 +156,8 @@ class ActivateBiometricsView extends StatelessWidget { context: context, builder: (context) => ConfirmDialog( title: l10n.biometricsNotSupported, - subtitle: l10n - .yourDeviceDoseNotSupportBiometricsAuthentication, + subtitle: + l10n.deviceDoNotSupportBiometricsAuthentication, yes: l10n.ok, ), ); diff --git a/lib/scan/cubit/scan_cubit.dart b/lib/scan/cubit/scan_cubit.dart index 0018040a4..a9511147e 100644 --- a/lib/scan/cubit/scan_cubit.dart +++ b/lib/scan/cubit/scan_cubit.dart @@ -130,7 +130,7 @@ class ScanCubit extends Cubit { message: StateMessage.error( messageHandler: ResponseMessage( ResponseString - .RESPONSE_STRING_pleaseSwitchToCorrectOIDC4VCProfile, + .RESPONSE_STRING_pleaseSwitchToRightOIDC4VCProfile, ), showDialog: false, duration: const Duration(seconds: 20), diff --git a/packages/oidc4vc/lib/src/oidc4vc.dart b/packages/oidc4vc/lib/src/oidc4vc.dart index b42b0157c..2d62f0c24 100644 --- a/packages/oidc4vc/lib/src/oidc4vc.dart +++ b/packages/oidc4vc/lib/src/oidc4vc.dart @@ -362,7 +362,8 @@ class OIDC4VC { } Future readTokenEndPoint( - Map openidConfigurationResponse) async { + Map openidConfigurationResponse, + ) async { late String tokenEndPoint; final authorizationServer = diff --git a/packages/oidc4vc/test/src/issuer_token_parameters/issuer_token_parameters_class.dart b/packages/oidc4vc/test/src/issuer_token_parameters/issuer_token_parameters_class.dart index 958026828..9cfff064d 100644 --- a/packages/oidc4vc/test/src/issuer_token_parameters/issuer_token_parameters_class.dart +++ b/packages/oidc4vc/test/src/issuer_token_parameters/issuer_token_parameters_class.dart @@ -38,15 +38,4 @@ class IssuerTokenParameterTest extends TokenParameterTest { final tokenParameters = IssuerTokenParameters(keyWithAlg, '', '', ''); expect(tokenParameters.alg, HS256Alg); } - - // @override - // void thumprintOfKey() { - // expect(tokenParameters.thumbprint, thumbprint); - // } - - // @override - // void thumprintOfKeyForrfc7638() { - // final tokenParameters2 = IssuerTokenParameters(rfc7638Jwk, '', '', '', ''); - // expect(tokenParameters2.thumbprint, expectedThumbprintForrfc7638Jwk); - // } } diff --git a/packages/oidc4vc/test/src/oidc4vc_test.dart b/packages/oidc4vc/test/src/oidc4vc_test.dart index 853c80941..2a570573c 100644 --- a/packages/oidc4vc/test/src/oidc4vc_test.dart +++ b/packages/oidc4vc/test/src/oidc4vc_test.dart @@ -1,3 +1,4 @@ +// ignore_for_file: lines_longer_than_80_chars // // Copyright (c) 2022, Very Good Ventures // // https://verygood.ventures // // diff --git a/packages/oidc4vc/test/src/token_parameters/token_parameters_test.dart b/packages/oidc4vc/test/src/token_parameters/token_parameters_test.dart index c638c2d62..a443a5713 100644 --- a/packages/oidc4vc/test/src/token_parameters/token_parameters_test.dart +++ b/packages/oidc4vc/test/src/token_parameters/token_parameters_test.dart @@ -7,6 +7,8 @@ // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. +// ignore_for_file: lines_longer_than_80_chars + import 'package:dio/dio.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; diff --git a/packages/polygonid/lib/src/polygonid.dart b/packages/polygonid/lib/src/polygonid.dart index 4e2fa8071..4f17a6fe8 100644 --- a/packages/polygonid/lib/src/polygonid.dart +++ b/packages/polygonid/lib/src/polygonid.dart @@ -499,7 +499,9 @@ class PolygonId { final String to = body.transactionData.contractAddress; final Iden3commProofEntity proof = response.first; + // ignore: lines_longer_than_80_chars const ABI = + // ignore: lines_longer_than_80_chars '[ { "inputs": [ { "internalType": "uint64", "name": "requestId", "type": "uint64" }, { "internalType": "uint256[]", "name": "inputs", "type": "uint256[]" }, { "internalType": "uint256[2]", "name": "a", "type": "uint256[2]" }, { "internalType": "uint256[2][2]", "name": "b", "type": "uint256[2][2]" }, { "internalType": "uint256[2]", "name": "c", "type": "uint256[2]" } ], "name": "submitZKPResponse", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" } ]'; final ContractAbi cAbi = ContractAbi.fromJson(ABI, to); diff --git a/pubspec.lock b/pubspec.lock index dd66a271f..224c5f37d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -390,10 +390,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" confetti: dependency: "direct main" description: @@ -1421,18 +1421,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" matrix: dependency: "direct main" description: @@ -2176,10 +2176,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: transitive description: @@ -2264,26 +2264,26 @@ packages: dependency: transitive description: name: test - sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" url: "https://pub.dev" source: hosted - version: "1.24.1" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.5.3" tezart: dependency: "direct main" description: @@ -2509,6 +2509,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web3dart: dependency: "direct overridden" description: @@ -2638,5 +2646,5 @@ packages: source: hosted version: "2.1.1" sdks: - dart: ">=3.0.0 <3.7.0" + dart: ">=3.1.0-185.0.dev <3.7.0" flutter: ">=3.10.0"