From de2af8ceafcb55bd4454ccadbf8c47652ba76d2f Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Wed, 26 Jun 2024 11:38:08 +0000 Subject: [PATCH 1/6] chore --- lib/app/shared/widget/button/my_elevated_button.dart | 1 - lib/dashboard/qr_code/widget/developer_mode_dialog.dart | 1 - packages/oidc4vc/lib/src/models/openid_configuration.dart | 1 - test/pin_code/view/pin_code_page_test.dart | 1 - 4 files changed, 4 deletions(-) diff --git a/lib/app/shared/widget/button/my_elevated_button.dart b/lib/app/shared/widget/button/my_elevated_button.dart index 230d1f1a7..7b909d6d6 100644 --- a/lib/app/shared/widget/button/my_elevated_button.dart +++ b/lib/app/shared/widget/button/my_elevated_button.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; class MyElevatedButton extends StatelessWidget { const MyElevatedButton({ diff --git a/lib/dashboard/qr_code/widget/developer_mode_dialog.dart b/lib/dashboard/qr_code/widget/developer_mode_dialog.dart index 4656487a0..7f6b617f5 100644 --- a/lib/dashboard/qr_code/widget/developer_mode_dialog.dart +++ b/lib/dashboard/qr_code/widget/developer_mode_dialog.dart @@ -16,7 +16,6 @@ class DeveloperModeDialog extends StatelessWidget { @override Widget build(BuildContext context) { - final color = Theme.of(context).colorScheme.primary; final background = Theme.of(context).colorScheme.surface; final textColor = Theme.of(context).colorScheme.onSurface; diff --git a/packages/oidc4vc/lib/src/models/openid_configuration.dart b/packages/oidc4vc/lib/src/models/openid_configuration.dart index 3184355a8..d537e90a4 100644 --- a/packages/oidc4vc/lib/src/models/openid_configuration.dart +++ b/packages/oidc4vc/lib/src/models/openid_configuration.dart @@ -26,7 +26,6 @@ class OpenIdConfiguration extends Equatable { this.credentialManifests, this.issuer, this.jwksUri, - required this.requirePushedAuthorizationRequests, this.grantTypesSupported, }); diff --git a/test/pin_code/view/pin_code_page_test.dart b/test/pin_code/view/pin_code_page_test.dart index 79b5a4f44..5aa9972e2 100644 --- a/test/pin_code/view/pin_code_page_test.dart +++ b/test/pin_code/view/pin_code_page_test.dart @@ -4,7 +4,6 @@ import 'package:altme/flavor/flavor.dart'; import 'package:altme/pin_code/pin_code.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockingjay/mockingjay.dart'; import 'package:secure_storage/secure_storage.dart'; From 5cf4775cab9b0e22f9ff454692c0afde51877b9e Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Thu, 27 Jun 2024 20:01:49 +0545 Subject: [PATCH 2/6] October (#2749) * some tests * feat: Re-request credential if error gives c_nonce #2734 * feat: New specs for wallet attestation PAR and token endpoing post call #2747 * fix: Pass parameters as header but not as body #2747 --- .../helper_functions/helper_functions.dart | 25 ++- .../cubit/qr_code_scan_cubit.dart | 30 ++-- .../get_authorization_uri_for_issuer.dart | 12 +- .../initiate_oidv4vc_credential_issuance.dart | 8 +- packages/oidc4vc/lib/src/oidc4vc.dart | 144 ++++++++++++------ packages/oidc4vc/test/src/oidc4vc_test.dart | 23 ++- test/lang/cubit/lang_cubit_test.dart | 94 ++++++++++++ test/lang/cubit/lang_state_test.dart | 33 ++++ 8 files changed, 294 insertions(+), 75 deletions(-) create mode 100644 test/lang/cubit/lang_cubit_test.dart create mode 100644 test/lang/cubit/lang_state_test.dart diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index 2d8e67fd5..418ed63ff 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -19,6 +19,7 @@ import 'package:key_generator/key_generator.dart'; import 'package:oidc4vc/oidc4vc.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:secure_storage/secure_storage.dart'; +import 'package:uuid/uuid.dart'; import 'package:x509/x509.dart' as x509; import 'package:x509/x509.dart'; @@ -1568,7 +1569,12 @@ bool supportCryptoCredential(ProfileModel profileModel) { return supportAssociatedCredential; } -Future<(String?, String?, String?, String?)> getClientDetails({ +// clientId, +// clientSecret, +// authorization, +// oAuthClientAttestation, +// oAuthClientAttestationPop +Future<(String?, String?, String?, String?, String?)> getClientDetails({ required ProfileCubit profileCubit, required bool isEBSIV3, required String issuer, @@ -1577,7 +1583,8 @@ Future<(String?, String?, String?, String?)> getClientDetails({ String? clientId; String? clientSecret; String? authorization; - String? clientAssertion; + String? oAuthClientAttestation; + String? oAuthClientAttestationPop; final customOidc4vcProfile = profileCubit.state.model.profileSetting .selfSovereignIdentityOptions.customOidc4vcProfile; @@ -1663,6 +1670,7 @@ Future<(String?, String?, String?, String?)> getClientDetails({ 'aud': issuer, 'nbf': nbf, 'exp': nbf + 60, + 'jti': const Uuid().v4(), }; final jwtProofOfPossession = profileCubit.oidc4vc.generateToken( @@ -1671,12 +1679,19 @@ Future<(String?, String?, String?, String?)> getClientDetails({ ignoreProofHeaderType: true, ); - clientAssertion = '$walletAttestationData~$jwtProofOfPossession'; + oAuthClientAttestation = walletAttestationData; + oAuthClientAttestationPop = jwtProofOfPossession; } - return (clientId, clientSecret, authorization, clientAssertion); + return ( + clientId, + clientSecret, + authorization, + oAuthClientAttestation, + oAuthClientAttestationPop + ); } catch (e) { - return (null, null, null, null); + return (null, null, null, null, null); } } 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 9a072754b..7d1045ba4 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 @@ -1185,8 +1185,13 @@ class QRCodeScanCubit extends Cubit { required dynamic credentialOfferJson, }) async { try { - final (clientId, clientSecret, authorization, clientAssertion) = - await getClientDetails( + final ( + clientId, + clientSecret, + authorization, + oAuthClientAttestation, + oAuthClientAttestationPop + ) = await getClientDetails( profileCubit: profileCubit, isEBSIV3: isEBSIV3, issuer: issuer, @@ -1207,7 +1212,8 @@ class QRCodeScanCubit extends Cubit { authorization: authorization, clientId: clientId ?? '', clientSecret: clientSecret, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, ); } else { emit(state.loading()); @@ -1227,7 +1233,8 @@ class QRCodeScanCubit extends Cubit { clientAuthentication: customOidc4vcProfile.clientAuthentication, oidc4vciDraftType: customOidc4vcProfile.oidc4vciDraft, vcFormatType: customOidc4vcProfile.vcFormatType, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, secureAuthorizedFlow: customOidc4vcProfile.pushAuthorizationRequest, client: client, ); @@ -1254,7 +1261,8 @@ class QRCodeScanCubit extends Cubit { required String? authorization, required String? clientId, required String? clientSecret, - required String? clientAssertion, + String? oAuthClientAttestation, + String? oAuthClientAttestationPop, }) async { try { for (int i = 0; i < selectedCredentials.length; i++) { @@ -1298,7 +1306,8 @@ class QRCodeScanCubit extends Cubit { oidc4vciDraftType: customOidc4vcProfile.oidc4vciDraft, redirectUri: Parameters.oidc4vcUniversalLink, openIdConfiguration: openIdConfiguration, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, dio: client.dio, ); @@ -1483,8 +1492,10 @@ class QRCodeScanCubit extends Cubit { final String? authorization = statePayload['authorization'] as String?; final String? clientId = statePayload['client_id'] as String?; final String? clientSecret = statePayload['client_secret'] as String?; - final String? clientAssertion = - statePayload['client_assertion'] as String?; + final String? oAuthClientAttestation = + statePayload['oAuthClientAttestation'] as String?; + final String? oAuthClientAttestationPop = + statePayload['oAuthClientAttestationPop'] as String?; await addCredentialsInLoop( selectedCredentials: selectedCredentials, @@ -1497,7 +1508,8 @@ class QRCodeScanCubit extends Cubit { authorization: authorization, clientId: clientId ?? '', clientSecret: clientSecret, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, ); } catch (e) { emitError(e); diff --git a/lib/oidc4vc/get_authorization_uri_for_issuer.dart b/lib/oidc4vc/get_authorization_uri_for_issuer.dart index 9dd413143..5f96a54d2 100644 --- a/lib/oidc4vc/get_authorization_uri_for_issuer.dart +++ b/lib/oidc4vc/get_authorization_uri_for_issuer.dart @@ -22,7 +22,8 @@ Future getAuthorizationUriForIssuer({ required ClientAuthentication clientAuthentication, required OIDC4VCIDraftType oidc4vciDraftType, required VCFormatType vcFormatType, - required String? clientAssertion, + String? oAuthClientAttestation, + String? oAuthClientAttestationPop, required bool secureAuthorizedFlow, required DioClient client, }) async { @@ -64,7 +65,8 @@ Future getAuthorizationUriForIssuer({ data['client_id'] = clientId!; case ClientAuthentication.clientSecretJwt: data['client_id'] = clientId!; - data['client_assertion'] = clientAssertion!; + data['oAuthClientAttestation'] = oAuthClientAttestation!; + data['oAuthClientAttestationPop'] = oAuthClientAttestationPop!; } final jwt = JWT(data); @@ -96,7 +98,8 @@ Future getAuthorizationUriForIssuer({ clientAuthentication: clientAuthentication, oidc4vciDraftType: oidc4vciDraftType, vcFormatType: vcFormatType, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, secureAuthorizedFlow: secureAuthorizedFlow, credentialOfferJson: credentialOfferJson, dio: client.dio, @@ -108,7 +111,10 @@ Future getAuthorizationUriForIssuer({ if (requirePushedAuthorizationRequests || secureAuthorizedFlow) { final headers = { 'Content-Type': 'application/x-www-form-urlencoded', + 'OAuth-Client-Attestation': oAuthClientAttestation, + 'OAuth-Client-Attestation-PoP': oAuthClientAttestationPop, }; + final parUrl = openIdConfiguration.pushedAuthorizationRequestEndpoint ?? '$authorizationEndpoint/par'; diff --git a/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart b/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart index 2702401bc..f81f0228f 100644 --- a/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart +++ b/lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart @@ -117,7 +117,10 @@ Future initiateOIDC4VCCredentialIssuance({ final String? authorization = jwt['authorization'] as String?; final String? clientId = jwt['client_id'] as String?; final String? clientSecret = jwt['client_secret'] as String?; - final String? clientAssertion = jwt['client_assertion'] as String?; + final String? oAuthClientAttestation = + jwt['oAuthClientAttestation'] as String?; + final String? oAuthClientAttestationPop = + jwt['oAuthClientAttestationPop'] as String?; final selectedCredentials = stateOfCredentialsSelected .map((index) => credentials[index]) @@ -134,7 +137,8 @@ Future initiateOIDC4VCCredentialIssuance({ authorization: authorization, clientId: clientId, clientSecret: clientSecret, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, ); } } diff --git a/packages/oidc4vc/lib/src/oidc4vc.dart b/packages/oidc4vc/lib/src/oidc4vc.dart index 486035582..29a0b0282 100644 --- a/packages/oidc4vc/lib/src/oidc4vc.dart +++ b/packages/oidc4vc/lib/src/oidc4vc.dart @@ -146,11 +146,12 @@ class OIDC4VC { required ClientAuthentication clientAuthentication, required OIDC4VCIDraftType oidc4vciDraftType, required VCFormatType vcFormatType, - required String? clientAssertion, required bool secureAuthorizedFlow, required Dio dio, required dynamic credentialOfferJson, SecureStorageProvider? secureStorage, + String? oAuthClientAttestation, + String? oAuthClientAttestationPop, }) async { try { final openIdConfiguration = await getOpenIdConfig( @@ -185,7 +186,6 @@ class OIDC4VC { clientAuthentication: clientAuthentication, oidc4vciDraftType: oidc4vciDraftType, vcFormatType: vcFormatType, - clientAssertion: clientAssertion, secureAuthorizedFlow: secureAuthorizedFlow, ); @@ -216,7 +216,6 @@ class OIDC4VC { required ClientAuthentication clientAuthentication, required OIDC4VCIDraftType oidc4vciDraftType, required VCFormatType vcFormatType, - required String? clientAssertion, required bool secureAuthorizedFlow, }) { //https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-successful-authorization-re @@ -360,13 +359,6 @@ class OIDC4VC { myRequest['client_id'] = clientId; case ClientAuthentication.clientSecretJwt: myRequest['client_id'] = clientId; - if (secureAuthorizedFlow || - openIdConfiguration.requirePushedAuthorizationRequests) { - myRequest['client_assertion'] = clientAssertion; - myRequest['client_assertion_type'] = - // ignore: lines_longer_than_80_chars - 'urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation'; - } } if (scope) { @@ -579,7 +571,8 @@ class OIDC4VC { String? code, String? codeVerifier, String? authorization, - String? clientAssertion, + String? oAuthClientAttestation, + String? oAuthClientAttestationPop, }) async { final tokenEndPoint = await readTokenEndPoint( openIdConfiguration: openIdConfiguration, @@ -602,7 +595,8 @@ class OIDC4VC { clientSecret: clientSecret, authorization: authorization, redirectUri: redirectUri, - clientAssertion: clientAssertion, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, ); tokenResponse = await getToken( @@ -610,6 +604,8 @@ class OIDC4VC { tokenData: tokenData, authorization: authorization, dio: dio, + oAuthClientAttestation: oAuthClientAttestation, + oAuthClientAttestationPop: oAuthClientAttestationPop, ); if (tokenResponse.containsKey('c_nonce')) { @@ -623,6 +619,8 @@ class OIDC4VC { return (tokenResponse, accessToken, cnonce, authorizationDetails); } + int count = 0; + Future getSingleCredential({ required IssuerTokenParameters issuerTokenParameters, required OpenIdConfiguration openIdConfiguration, @@ -644,44 +642,87 @@ class OIDC4VC { required String? nonce, required Dio dio, }) async { - final credentialData = await buildCredentialData( - nonce: nonce, - issuerTokenParameters: issuerTokenParameters, - openIdConfiguration: openIdConfiguration, - credentialType: credentialType, - types: types, - format: format, - credentialIdentifier: credentialIdentifier, - cryptoHolderBinding: cryptoHolderBinding, - oidc4vciDraftType: oidc4vciDraftType, - credentialDefinition: credentialDefinition, - clientAuthentication: clientAuthentication, - vct: vct, - proofType: proofType, - did: did, - issuer: issuer, - kid: kid, - privateKey: privateKey, - ); + try { + final credentialData = await buildCredentialData( + nonce: nonce, + issuerTokenParameters: issuerTokenParameters, + openIdConfiguration: openIdConfiguration, + credentialType: credentialType, + types: types, + format: format, + credentialIdentifier: credentialIdentifier, + cryptoHolderBinding: cryptoHolderBinding, + oidc4vciDraftType: oidc4vciDraftType, + credentialDefinition: credentialDefinition, + clientAuthentication: clientAuthentication, + vct: vct, + proofType: proofType, + did: did, + issuer: issuer, + kid: kid, + privateKey: privateKey, + ); - /// sign proof + /// sign proof - final credentialEndpoint = readCredentialEndpoint(openIdConfiguration); + final credentialEndpoint = readCredentialEndpoint(openIdConfiguration); - final credentialHeaders = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer $accessToken', - }; + final credentialHeaders = { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer $accessToken', + }; - final dynamic credentialResponse = await dio.post( - credentialEndpoint, - options: Options(headers: credentialHeaders), - data: credentialData, - ); + final dynamic credentialResponse = await dio.post( + credentialEndpoint, + options: Options(headers: credentialHeaders), + data: credentialData, + ); - final credentialResponseData = credentialResponse.data; + final credentialResponseData = credentialResponse.data; - return credentialResponseData; + return credentialResponseData; + } catch (e) { + if (count == 1) { + count = 0; + rethrow; + } + + if (e is DioException && + e.response != null && + e.response!.data is Map && + (e.response!.data as Map).containsKey('c_nonce')) { + count++; + + final nonce = e.response!.data['c_nonce'].toString(); + + final credentialResponseDataValue = await getSingleCredential( + issuerTokenParameters: issuerTokenParameters, + openIdConfiguration: openIdConfiguration, + credentialType: credentialType, + types: types, + format: format, + cryptoHolderBinding: cryptoHolderBinding, + oidc4vciDraftType: oidc4vciDraftType, + credentialDefinition: credentialDefinition, + clientAuthentication: clientAuthentication, + vct: vct, + credentialIdentifier: null, + proofType: proofType, + did: did, + issuer: issuer, + kid: kid, + privateKey: privateKey, + accessToken: accessToken, + nonce: nonce, + dio: dio, + ); + count = 0; + return credentialResponseDataValue; + } else { + count = 0; + rethrow; + } + } } /// get Deferred credential from url @@ -709,7 +750,8 @@ class OIDC4VC { String? clientId, String? clientSecret, String? authorization, - String? clientAssertion, + String? oAuthClientAttestation, + String? oAuthClientAttestationPop, }) { late Map tokenData; @@ -734,10 +776,7 @@ class OIDC4VC { if (clientSecret != null) tokenData['client_secret'] = clientSecret; } - if (clientAssertion != null) { - tokenData['client_assertion_type'] = - 'urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation'; - tokenData['client_assertion'] = clientAssertion; + if (oAuthClientAttestation != null && oAuthClientAttestationPop != null) { tokenData['client_id'] = clientId; } @@ -1370,6 +1409,8 @@ class OIDC4VC { required Map tokenData, required String? authorization, required Dio dio, + required String? oAuthClientAttestation, + required String? oAuthClientAttestationPop, }) async { /// getting token final tokenHeaders = { @@ -1380,6 +1421,11 @@ class OIDC4VC { tokenHeaders['Authorization'] = 'Basic $authorization'; } + if (oAuthClientAttestation != null && oAuthClientAttestationPop != null) { + tokenHeaders['OAuth-Client-Attestation'] = oAuthClientAttestation; + tokenHeaders['OAuth-Client-Attestation-PoP'] = oAuthClientAttestationPop; + } + final dynamic tokenResponse = await dio.post>( tokenEndPoint, options: Options(headers: tokenHeaders), diff --git a/packages/oidc4vc/test/src/oidc4vc_test.dart b/packages/oidc4vc/test/src/oidc4vc_test.dart index c79a0db85..c1d3068a9 100644 --- a/packages/oidc4vc/test/src/oidc4vc_test.dart +++ b/packages/oidc4vc/test/src/oidc4vc_test.dart @@ -271,7 +271,6 @@ void main() { clientAuthentication: ClientAuthentication.clientId, oidc4vciDraftType: OIDC4VCIDraftType.draft13, vcFormatType: VCFormatType.jwtVcJson, - clientAssertion: null, secureAuthorizedFlow: false, issuer: issuer, dio: client, @@ -303,7 +302,6 @@ void main() { '', ), authorizationEndPoint: '', - clientAssertion: '', clientAuthentication: ClientAuthentication.clientId, clientSecret: '', oidc4vciDraftType: OIDC4VCIDraftType.draft11, @@ -336,7 +334,6 @@ void main() { selectedCredentials: selectedCredentials, clientId: clientId, authorizationEndPoint: authorizationEndPoint, - clientAssertion: null, scope: false, clientAuthentication: ClientAuthentication.clientId, oidc4vciDraftType: OIDC4VCIDraftType.draft13, @@ -427,8 +424,10 @@ void main() { clientAuthentication: ClientAuthentication.clientId, oidc4vciDraftType: OIDC4VCIDraftType.draft13, vcFormatType: VCFormatType.jwtVcJson, - clientAssertion: - 'eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6dGFsYW8uY28ja2V5LTIiLCJ0eXAiOiJ3YWxsZXQtYXR0ZXN0YXRpb24rand0In0.eyJhdXRob3JpemF0aW9uX2VuZHBvaW50IjoiaHR0cHM6Ly9hcHAuYWx0bWUuaW8vYXBwL2Rvd25sb2FkL2F1dGhvcml6ZSIsImNsaWVudF9pZF9zY2hlbWVzX3N1cHBvcnRlZCI6WyJkaWQiLCJyZWRpcmVjdF91cmkiLCJ4NTA5X3Nhbl9kbnMiLCJ2ZXJpZmllcl9hdHRlc3RhdGlvbiJdLCJjbmYiOnsiandrIjp7ImNydiI6IlAtMjU2Iiwia2lkIjoiOGI2cEhFa21JY1N2cG1oM0xQRU03ZGpIUXZMZUZZeEZrYVR4YjFEYmZaUSIsImt0eSI6IkVDIiwieCI6IkVQb194VkhFai1QYzB1eGJtY3hNajJMNjZQb0doLXVvWUdBemdHS012T1EiLCJ5IjoiRndGSDF2S1ZHX2c3QkdiT0NIY3dZcnFKdFJINnVDTFU5aUliUGF4S1dWQSJ9fSwiZXhwIjoxNzQ5OTEyNjYwLCJncmFudF90eXBlc19zdXBwb3J0ZWQiOlsiYXV0aG9yaXphdGlvbl9jb2RlIiwicHJlLWF1dGhvcml6ZWRfY29kZSJdLCJpYXQiOjE3MTgzNzY2NjAsImlzcyI6ImRpZDp3ZWI6dGFsYW8uY28iLCJqdGkiOiI4YzZkZjFlNi0yYTVkLTExZWYtYjQwYy0wYTE2Mjg5NTg1NjAiLCJrZXlfdHlwZSI6InNvZnR3YXJlIiwibm9uY2UiOiI4YzRkNDg2YS0yYTVkLTExZWYtYjQwYy0wYTE2Mjg5NTg1NjAiLCJwcmVzZW50YX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MDkwNCwiZXhwIjoxNzE4NjMwOTY0fQ.versm2Ejz9W5uVbejGiOl1ytAoAHSeo5zZLer-hhiWBm8y1QgCmFB5xay4xWi3Nlx2KC2f1wsZ6tMVsrfZD2rg', secureAuthorizedFlow: true, issuer: issuer, dio: client, @@ -487,8 +486,10 @@ void main() { clientAuthentication: ClientAuthentication.clientId, oidc4vciDraftType: OIDC4VCIDraftType.draft13, vcFormatType: VCFormatType.jwtVcJson, - clientAssertion: - 'eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6dGFsYW8uY28ja2V5LTIiLCJ0eXAiOiJ3YWxsZXQtYXR0ZXN0YXRpb24rand0In0.eyJhdXRob3JpemF0aW9uX2VuZHBvaW50IjoiaHR0cHM6Ly9hcHAuYWx0bWUuaW8vYXBwL2Rvd25sb2FkL2F1dGhvcml6ZSIsImNsaWVudF9pZF9zY2hlbWVzX3N1cHBvcnRlZCI6WyJkaWQiLCJyZWRpcmVjdF91cmkiLCJ4NTA5X3Nhbl9kbnMiLCJ2ZXJpZmllcl9hdHRlc3RhdGlvbiJdLCJjbmYiOnsiandrIjp7ImNydiI6IlAtMjU2Iiwia2lkIjoiOGI2cEhFa21JY1N2cG1oM0xQRU03ZGpIUXZMZUZZeEZrYVR4YjFEYmZaUSIsImt0eSI6IkVDIiwieCI6IkVQb194VkhFai1QYzB1eGJtY3hNajJMNjZQb0doLXVvWUdBemdHS012T1EiLCJ5IjoiRndGSDF2S1ZHX2c3QkdiT0NIY3dZcnFKdFJINnVDTFU5aUliUGF4S1dWQSJ9fSwiZXhwIjoxNzQ5OTEyNjYwLCJncmFudF90eXBlc19zdXBwb3J0ZWQiOlsiYXV0aG9yaXphdGlvbl9jb2RlIiwicHJlLWF1dGhvcml6ZWRfY29kZSJdLCJpYXQiOjE3MTgzNzY2NjAsImlzcyI6ImRpZDp3ZWI6dGFsYW8uY28iLCJqdGkiOiI4YzZkZjFlNi0yYTVkLTExZWYtYjQwYy0wYTE2Mjg5NTg1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gzTFBFTTdkakhRdkxlRll4RmthVHhiMURiZlpRIiwiYXVkIjoiaHR0cHM6Ly90YWxhby5jby9pc3N1ZXIvZ3Jsdnpja29meSIsIm5iZiI6MTcxODYzMDkwNCwiZXhwIjoxNzE4NjMwOTY0fQ.versm2Ejz9W5uVbejGiOl1ytAoAHSeo5zZLer-hhiWBm8y1QgCmFB5xay4xWi3Nlx2KC2f1wsZ6tMVsrfZD2rg', secureAuthorizedFlow: true, issuer: issuer, dio: client, @@ -844,6 +845,10 @@ void main() { tokenData: tokenData, tokenEndPoint: tokenEndPoint, authorization: null, + oAuthClientAttestation: + 'eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6dGFsYW8uY28ja2V5LTIiLCJ0eXAiOiJ3YWxsZXQtYXR0ZXN0YXRpb24rand0In0.eyJhdXRob3JpemF0aW9uX2VuZHBvaW50IjoiaHR0cHM6Ly9hcHAuYWx0bWUuaW8vYXBwL2Rvd25sb2FkL2F1dGhvcml6ZSIsImNsaWVudF9pZF9zY2hlbWVzX3N1cHBvcnRlZCI6WyJkaWQiLCJyZWRpcmVjdF91cmkiLCJ4NTA5X3Nhbl9kbnMiLCJ2ZXJpZmllcl9hdHRlc3RhdGlvbiJdLCJjbmYiOnsiandrIjp7ImNydiI6IlAtMjU2Iiwia2lkIjoiOGI2cEhFa21JY1N2cG1oM0xQRU03ZGpIUXZMZUZZeEZrYVR4YjFEYmZaUSIsImt0eSI6IkVDIiwieCI6IkVQb194VkhFai1QYzB1eGJtY3hNajJMNjZQb0doLXVvWUdBemdHS012T1EiLCJ5IjoiRndGSDF2S1ZHX2c3QkdiT0NIY3dZcnFKdFJINnVDTFU5aUliUGF4S1dWQSJ9fSwiZXhwIjoxNzQ5OTEyNjYwLCJncmFudF90eXBlc19zdXBwb3J0ZWQiOlsiYXV0aG9yaXphdGlvbl9jb2RlIiwicHJlLWF1dGhvcml6ZWRfY29kZSJdLCJpYXQiOjE3MTgzNzY2NjAsImlzcyI6ImRpZD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UA', + oAuthClientAttestationPop: + 'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4YjZwSEVrbUljU3ZwbWgzTFBFTTdkakhRdkxlRll4RmthVHhiMURiZlpRIiwiYXVkIjoiaHR0cHM6Ly90YWxhby5jby9pc3N1ZXIvZ3Jsdnpja29meSIsIm5iZiI6MTcxODYzMDkwNCwiZXhwIjoxNzE4NjMwOTY0fQ.versm2Ejz9W5uVbejGiOl1ytAoAHSeo5zZLer-hhiWBm8y1QgCmFB5xay4xWi3Nlx2KC2f1wsZ6tMVsrfZD2rg', ); expect(jsonEncode(token), expectedValue); @@ -867,6 +872,10 @@ void main() { tokenData: tokenData, tokenEndPoint: tokenEndPoint, authorization: null, + oAuthClientAttestation: + 'eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6dGFsYW8uY28ja2V5LTIiLCJ0eXAiOiJ3YWxsZXQtYXR0ZXN0YXRpb24rand0In0.eyJhdXRob3JpemF0aW9uX2VuZHBvaW50IjoiaHR0cHM6Ly9hcHAuYWx0bWUuaW8vYXBwL2Rvd25sb2FkL2F1dGhvcml6ZSIsImNsaWVudF9pZF9zY2hlbWVzX3N1cHBvcnRlZCI6WyJkaWQiLCJyZWRpcmVjdF91cmkiLCJ4NTA5X3Nhbl9kbnMiLCJ2ZXJpZmllcl9hdHRlc3RhdGlvbiJdLCJjbmYiOnsiandrIjp7ImNydiI6IlAtMjU2Iiwia2lkIjoiOGI2cEhFa21JY1N2cG1oM0xQRU03ZGpIUXZMZUZZeEZrYVR4YjFEYmZaUSIsImt0eSI6IkVDIiwieCI6IkVQb194VkhFai1QYzB1eGJtY3hNajJMNjZQb0doLXVvWUdBemdHS012T1EiLCJ5IjoiRndGSDF2S1ZHX2c3QkdiT0NIY3dZcnFKdFJINnVDTFU5aUliUGF4S1dWQSJ9fSwiZXhwIjoxNzQ5OTEyNjYwLCJncmFudF90eXBlc19zdXBwb3J0ZWQiOlsiYXV0aG9yaXph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BTw1ppqvSuKtxbf-lhxhjb1HaaBvnWHk1J0ZMNah6D0Ucr1WzofXYPbJkksz3AwLrkAx5HyBdt4NP0anIUA', + oAuthClientAttestationPop: + 'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4YjZwSEVrbUljU3ZwbWgzTFBFTTdkakhRdkxlRll4RmthVHhiMURiZlpRIiwiYXVkIjoiaHR0cHM6Ly90YWxhby5jby9pc3N1ZXIvZ3Jsdnpja29meSIsIm5iZiI6MTcxODYzMDkwNCwiZXhwIjoxNzE4NjMwOTY0fQ.versm2Ejz9W5uVbejGiOl1ytAoAHSeo5zZLer-hhiWBm8y1QgCmFB5xay4xWi3Nlx2KC2f1wsZ6tMVsrfZD2rg', ); }, throwsA(isA()), diff --git a/test/lang/cubit/lang_cubit_test.dart b/test/lang/cubit/lang_cubit_test.dart new file mode 100644 index 000000000..3ede1cf10 --- /dev/null +++ b/test/lang/cubit/lang_cubit_test.dart @@ -0,0 +1,94 @@ +import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/enum/type/language_type.dart'; +import 'package:altme/lang/cubit/lang_cubit.dart'; +import 'package:altme/lang/cubit/lang_state.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:secure_storage/secure_storage.dart'; + +class MockSecureStorageProvider extends Mock implements SecureStorageProvider {} + +void main() { + late MockSecureStorageProvider mockSecureStorageProvider; + late LangCubit langCubit; + + setUp(() { + WidgetsFlutterBinding.ensureInitialized(); + mockSecureStorageProvider = MockSecureStorageProvider(); + langCubit = LangCubit(secureStorageProvider: mockSecureStorageProvider); + }); + + tearDown(() { + langCubit.close(); + }); + + group('LangCubit', () { + test('initial state is LangState with Locale(en) and LanguageType.phone', + () { + expect( + langCubit.state, + const LangState( + locale: Locale('en'), + languageType: LanguageType.phone, + ), + ); + }); + + test('emits new state with recorded language locale', () async { + when(() => mockSecureStorageProvider.get(SecureStorageKeys.language)) + .thenAnswer((_) async => 'es'); + when(() => + mockSecureStorageProvider.set(SecureStorageKeys.language, any())) + .thenAnswer((_) async {}); + + await langCubit.checkLocale(); + expect( + langCubit.state, + const LangState(locale: Locale('es'), languageType: LanguageType.es), + ); + }); + + test('returns LanguageType.phone when no recorded language', () async { + when(() => mockSecureStorageProvider.get(SecureStorageKeys.language)) + .thenAnswer((_) async => null); + when(() => + mockSecureStorageProvider.set(SecureStorageKeys.language, any())) + .thenAnswer((_) async {}); + + final languageType = await langCubit.getRecordedLanguage(); + expect(languageType, LanguageType.phone); + }); + + test('returns recorded language when available', () async { + when(() => mockSecureStorageProvider.get(SecureStorageKeys.language)) + .thenAnswer((_) async => 'es'); + + final languageType = await langCubit.getRecordedLanguage(); + expect(languageType, LanguageType.es); + }); + + test('returns matching LanguageType enum value', () { + final result = langCubit.getLanguageType('fr', LanguageType.phone); + expect(result, LanguageType.fr); + }); + + test('returns default LanguageType when no match found', () { + final result = langCubit.getLanguageType('unknown', LanguageType.phone); + expect(result, LanguageType.phone); + }); + + test('calls secureStorageProvider.set with correct key and value', + () async { + when(() => + mockSecureStorageProvider.set(SecureStorageKeys.language, any())) + .thenAnswer((_) async {}); + + await langCubit.recordLanguage('fr'); + + verify(() => + mockSecureStorageProvider.set(SecureStorageKeys.language, 'fr')) + .called(1); + }); + }); +} diff --git a/test/lang/cubit/lang_state_test.dart b/test/lang/cubit/lang_state_test.dart new file mode 100644 index 000000000..697da32d0 --- /dev/null +++ b/test/lang/cubit/lang_state_test.dart @@ -0,0 +1,33 @@ +import 'dart:ui'; + +import 'package:altme/app/shared/enum/type/language_type.dart'; +import 'package:altme/lang/cubit/lang_state.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('LangState', () { + const locale = Locale('en', 'US'); + const languageType = LanguageType.en; + + test('supports value comparisons', () { + expect( + const LangState(locale: locale, languageType: languageType), + const LangState(locale: locale, languageType: languageType), + ); + }); + + test('copyWith updates locale', () { + const newLocale = Locale('fr', 'FR'); + expect( + const LangState(locale: locale, languageType: languageType) + .copyWith(locale: newLocale), + const LangState(locale: newLocale, languageType: languageType), + ); + }); + + test('copyWith with no arguments returns the same instance', () { + const state = LangState(locale: locale, languageType: languageType); + expect(state.copyWith(), state); + }); + }); +} From 2f8c4bc311c49e469d19a09bf9d2e891d5894651 Mon Sep 17 00:00:00 2001 From: hawkbee <49282360+hawkbee1@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:17:13 +0200 Subject: [PATCH 3/6] Talao logo #2744 (#2748) * Talao logo #2744 * feat: Update logo instantly and test update --------- Co-authored-by: Bibash Shrestha --- lib/app/shared/loading/loading_view.dart | 3 - lib/app/shared/widget/wallet_logo.dart | 129 +++--- ...congratulations_account_creation_page.dart | 2 - .../congratulations_account_import_page.dart | 2 - .../verify_age/view/ai_age_result_page.dart | 2 - .../src/view/check_linkedin_profile.dart | 2 - .../ssi/backup/src/view/backup_menu.dart | 2 - .../drawer/ssi/manage_did/view/did_menu.dart | 1 - .../ssi/restore/src/view/restore_menu.dart | 2 - .../view/advanced_security_settings_menu.dart | 1 - .../recovery_key/view/key_verified_page.dart | 4 - lib/dashboard/drawer/widget/drawer_logo.dart | 3 - lib/onboarding/starter/view/starter_page.dart | 1 - .../wallet_ready/view/wallet_ready_page.dart | 1 - lib/pin_code/widgets/pin_code_widget.dart | 4 - lib/splash/view/splash_page.dart | 1 - test/app/shared/widget/wallet_logo_test.dart | 388 ++++++++++++------ 17 files changed, 315 insertions(+), 233 deletions(-) diff --git a/lib/app/shared/loading/loading_view.dart b/lib/app/shared/loading/loading_view.dart index a2ed95cf9..5a82c11aa 100644 --- a/lib/app/shared/loading/loading_view.dart +++ b/lib/app/shared/loading/loading_view.dart @@ -1,11 +1,9 @@ import 'dart:async'; import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class LoadingView { factory LoadingView() => _shared; @@ -67,7 +65,6 @@ class LoadingView { children: [ const SizedBox(height: 10), WalletLogo( - profileModel: context.read().state.model, height: Sizes.logoNormal, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/app/shared/widget/wallet_logo.dart b/lib/app/shared/widget/wallet_logo.dart index 42d4744b1..0d27d05d2 100644 --- a/lib/app/shared/widget/wallet_logo.dart +++ b/lib/app/shared/widget/wallet_logo.dart @@ -7,102 +7,67 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class WalletLogo extends StatelessWidget { const WalletLogo({ super.key, - required this.profileModel, this.height, this.width, this.showPoweredBy = false, }); - final ProfileModel profileModel; final double? height; final double? width; final bool showPoweredBy; @override Widget build(BuildContext context) { - final FlavorCubit flavorCubit = context.read(); - String image = ''; + return BlocBuilder( + builder: (context, state) { + final FlavorCubit flavorCubit = context.read(); + String image = ''; - switch (profileModel.profileType) { - case ProfileType.custom: - case ProfileType.dutch: - case ProfileType.defaultOne: - image = flavorCubit.state == FlavorMode.development - ? ImageStrings.appLogoDev - : flavorCubit.state == FlavorMode.staging - ? ImageStrings.appLogoStage - : ImageStrings.appLogo; - case ProfileType.ebsiV3: - image = ImageStrings.ebsiLogo; - case ProfileType.enterprise: - image = profileModel.profileSetting.generalOptions.companyLogo; - case ProfileType.owfBaselineProfile: - image = ImageStrings.owfBaselineProfileLogo; - } + final profileModel = state.model; - return Column( - children: [ - Center( - child: profileModel.profileType != ProfileType.enterprise - ? ColorFiltered( - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.primaryContainer, - BlendMode.srcIn, - ), - child: Logo( - width: width, - height: height, - profileModel: profileModel, - image: image, - ), - ) - : Logo( - width: width, - height: height, - profileModel: profileModel, - image: image, - ), - ), - ], - ); - } -} - -class Logo extends StatelessWidget { - const Logo({ - super.key, - required this.width, - required this.height, - required this.profileModel, - required this.image, - }); - - final double? width; - final double? height; - final ProfileModel profileModel; - final String image; - - @override - Widget build(BuildContext context) { - return SizedBox( - width: width, - height: height, - child: profileModel.profileType == ProfileType.enterprise - ? CachedImageFromNetwork( - image, - fit: BoxFit.contain, - width: width, - bgColor: Colors.transparent, - height: height, - errorMessage: '', - showLoading: false, - ) - : Image.asset( - image, - fit: BoxFit.contain, - width: width, - height: height, + switch (profileModel.profileType) { + case ProfileType.custom: + case ProfileType.dutch: + case ProfileType.defaultOne: + image = flavorCubit.state == FlavorMode.development + ? ImageStrings.appLogoDev + : flavorCubit.state == FlavorMode.staging + ? ImageStrings.appLogoStage + : ImageStrings.appLogo; + case ProfileType.ebsiV3: + image = ImageStrings.ebsiLogo; + case ProfileType.enterprise: + image = profileModel.profileSetting.generalOptions.companyLogo; + case ProfileType.owfBaselineProfile: + image = ImageStrings.owfBaselineProfileLogo; + } + return Column( + children: [ + Center( + child: SizedBox( + width: width, + height: height, + child: profileModel.profileType == ProfileType.enterprise + ? CachedImageFromNetwork( + image, + fit: BoxFit.contain, + width: width, + bgColor: Colors.transparent, + height: height, + errorMessage: '', + showLoading: false, + ) + : Image.asset( + image, + fit: BoxFit.contain, + width: width, + height: height, + ), + ), ), + ], + ); + }, ); } } diff --git a/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart b/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart index e7ed97d9c..27912563a 100644 --- a/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart +++ b/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart @@ -3,7 +3,6 @@ import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:confetti/confetti.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:key_generator/key_generator.dart'; class CongratulationsAccountCreationPage extends StatelessWidget { @@ -106,7 +105,6 @@ class _CongratulationsAccountCreationViewState crossAxisAlignment: CrossAxisAlignment.center, children: [ WalletLogo( - profileModel: context.read().state.model, height: Sizes.logo2XLarge, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/add_account/import_account/view/congratulations_account_import_page.dart b/lib/dashboard/add_account/import_account/view/congratulations_account_import_page.dart index 98f2fed76..8d9154319 100644 --- a/lib/dashboard/add_account/import_account/view/congratulations_account_import_page.dart +++ b/lib/dashboard/add_account/import_account/view/congratulations_account_import_page.dart @@ -3,7 +3,6 @@ import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:confetti/confetti.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class CongratulationsAccountImportPage extends StatelessWidget { const CongratulationsAccountImportPage({ @@ -68,7 +67,6 @@ class _CongratulationsAccountImportViewState crossAxisAlignment: CrossAxisAlignment.center, children: [ WalletLogo( - profileModel: context.read().state.model, height: Sizes.logo2XLarge, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, 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 046e23eba..860bed6a2 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 @@ -116,7 +116,6 @@ class SuccessWidget extends StatelessWidget { children: [ const Spacer(), WalletLogo( - profileModel: context.read().state.model, height: Sizes.logo2XLarge, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, @@ -176,7 +175,6 @@ class FailureWidget extends StatelessWidget { children: [ const Spacer(), WalletLogo( - profileModel: context.read().state.model, height: Sizes.logo2XLarge, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/src/view/check_linkedin_profile.dart b/lib/dashboard/drawer/src/view/check_linkedin_profile.dart index 5661d5f6e..539fcbed5 100644 --- a/lib/dashboard/drawer/src/view/check_linkedin_profile.dart +++ b/lib/dashboard/drawer/src/view/check_linkedin_profile.dart @@ -4,7 +4,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class CheckForLinkedInProfile extends StatelessWidget { const CheckForLinkedInProfile({super.key}); @@ -41,7 +40,6 @@ class CheckForLinkedInProfileView extends StatelessWidget { padding: EdgeInsets.zero, ), WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart b/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart index 780ddff33..df0d3774c 100644 --- a/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart +++ b/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart @@ -2,7 +2,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class BackupMenu extends StatelessWidget { const BackupMenu({super.key}); @@ -39,7 +38,6 @@ class BackupView extends StatelessWidget { padding: EdgeInsets.zero, ), WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/ssi/manage_did/view/did_menu.dart b/lib/dashboard/drawer/ssi/manage_did/view/did_menu.dart index efc1204d5..191e8ab98 100644 --- a/lib/dashboard/drawer/ssi/manage_did/view/did_menu.dart +++ b/lib/dashboard/drawer/ssi/manage_did/view/did_menu.dart @@ -40,7 +40,6 @@ class DidView extends StatelessWidget { padding: EdgeInsets.zero, ), WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart b/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart index c3bdd7a8f..905cd5cdc 100644 --- a/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart +++ b/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart @@ -2,7 +2,6 @@ import 'package:altme/app/app.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class RestoreMenu extends StatelessWidget { const RestoreMenu({super.key}); @@ -39,7 +38,6 @@ class RestoreView extends StatelessWidget { padding: EdgeInsets.zero, ), WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/wallet_security/advanced_security_settings/view/advanced_security_settings_menu.dart b/lib/dashboard/drawer/wallet_security/advanced_security_settings/view/advanced_security_settings_menu.dart index 8b8fd1655..cc93f0c63 100644 --- a/lib/dashboard/drawer/wallet_security/advanced_security_settings/view/advanced_security_settings_menu.dart +++ b/lib/dashboard/drawer/wallet_security/advanced_security_settings/view/advanced_security_settings_menu.dart @@ -41,7 +41,6 @@ class AdvancedSecuritySettingsView extends StatelessWidget { padding: EdgeInsets.zero, ), WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/wallet_security/recovery_key/view/key_verified_page.dart b/lib/dashboard/drawer/wallet_security/recovery_key/view/key_verified_page.dart index 839ac7b5d..b1e9a892d 100644 --- a/lib/dashboard/drawer/wallet_security/recovery_key/view/key_verified_page.dart +++ b/lib/dashboard/drawer/wallet_security/recovery_key/view/key_verified_page.dart @@ -1,9 +1,6 @@ import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; -//import 'package:confetti/confetti.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class KeyVerifiedPage extends StatelessWidget { const KeyVerifiedPage({super.key}); @@ -37,7 +34,6 @@ class KeyVerifiedView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/dashboard/drawer/widget/drawer_logo.dart b/lib/dashboard/drawer/widget/drawer_logo.dart index b6acab6a9..e19095996 100644 --- a/lib/dashboard/drawer/widget/drawer_logo.dart +++ b/lib/dashboard/drawer/widget/drawer_logo.dart @@ -1,8 +1,6 @@ import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/dashboard.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; class DrawerLogo extends StatelessWidget { const DrawerLogo({super.key}); @@ -13,7 +11,6 @@ class DrawerLogo extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ WalletLogo( - profileModel: context.read().state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/onboarding/starter/view/starter_page.dart b/lib/onboarding/starter/view/starter_page.dart index 74843bfc4..d9ae2f70d 100644 --- a/lib/onboarding/starter/view/starter_page.dart +++ b/lib/onboarding/starter/view/starter_page.dart @@ -62,7 +62,6 @@ class StarterView extends StatelessWidget { children: [ const Spacer(flex: 5), WalletLogo( - profileModel: state.model, width: MediaQuery.of(context).size.shortestSide * 0.6, height: MediaQuery.of(context).size.longestSide * 0.2, ), diff --git a/lib/onboarding/wallet_ready/view/wallet_ready_page.dart b/lib/onboarding/wallet_ready/view/wallet_ready_page.dart index 5f80f6768..e1c654fde 100644 --- a/lib/onboarding/wallet_ready/view/wallet_ready_page.dart +++ b/lib/onboarding/wallet_ready/view/wallet_ready_page.dart @@ -89,7 +89,6 @@ class _WalletReadyViewState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ WalletLogo( - profileModel: widget.profileCubit.state.model, height: 90, width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, diff --git a/lib/pin_code/widgets/pin_code_widget.dart b/lib/pin_code/widgets/pin_code_widget.dart index 54229044e..06da6a7cd 100644 --- a/lib/pin_code/widgets/pin_code_widget.dart +++ b/lib/pin_code/widgets/pin_code_widget.dart @@ -107,10 +107,6 @@ class _PinCodeWidgetState extends State widget.header! else WalletLogo( - profileModel: context - .read() - .state - .model, height: 90, width: MediaQuery.of(context) .size diff --git a/lib/splash/view/splash_page.dart b/lib/splash/view/splash_page.dart index f66cfb19a..22c1a9d43 100644 --- a/lib/splash/view/splash_page.dart +++ b/lib/splash/view/splash_page.dart @@ -283,7 +283,6 @@ class _SplashViewState extends State { children: [ const Spacer(flex: 2), WalletLogo( - profileModel: state.model, width: MediaQuery.of(context).size.shortestSide * 0.6, height: MediaQuery.of(context).size.longestSide * 0.2, ), diff --git a/test/app/shared/widget/wallet_logo_test.dart b/test/app/shared/widget/wallet_logo_test.dart index 845453258..fff40b6fc 100644 --- a/test/app/shared/widget/wallet_logo_test.dart +++ b/test/app/shared/widget/wallet_logo_test.dart @@ -5,43 +5,50 @@ import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; import '../../../helpers/helpers.dart'; -class MockFlavorCubit extends MockCubit implements FlavorCubit { - @override - final state = FlavorMode.development; -} +class MockFlavorCubit extends MockCubit implements FlavorCubit {} -void main() { - late FlavorCubit mockFlavorCubit; +class MockProfileCubit extends MockCubit + implements ProfileCubit {} - setUpAll(() { - mockFlavorCubit = MockFlavorCubit(); - }); +void main() { + final MockFlavorCubit mockFlavorCubit = MockFlavorCubit(); + final MockProfileCubit mockProfileCubit = MockProfileCubit(); group('WalletLogo widget', () { testWidgets( 'displays correct image for ProfileType.defaultOne in development', (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); + when(() => mockProfileCubit.state).thenReturn( + ProfileState( + model: ProfileModel.defaultOne( + polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, + walletType: WalletType.personal, + walletProtectionType: WalletProtectionType.FA2, + isDeveloperMode: true, + clientId: 'clientId', + clientSecret: 'clientSecret', + ), + ), + ); await tester.pumpApp( Scaffold( body: Builder( builder: (context) { - return BlocProvider( - create: (context) => mockFlavorCubit, - child: WalletLogo( - height: 100, - width: 100, - profileModel: ProfileModel.defaultOne( - polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, - walletType: WalletType.personal, - walletProtectionType: WalletProtectionType.FA2, - isDeveloperMode: true, - clientId: 'clientId', - clientSecret: 'clientSecret', + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, ), - ), + BlocProvider( + create: (context) => mockProfileCubit, + ), + ], + child: const WalletLogo(height: 100, width: 100), ); }, ), @@ -49,52 +56,151 @@ void main() { ); await tester.pumpAndSettle(); - expect(find.byType(Image), findsOneWidget); + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.appLogoDev); }); - testWidgets('displays correct image for ProfileType.custom in development', - (WidgetTester tester) async { - await tester.pumpApp( - Scaffold( - body: Builder( - builder: (context) { - return BlocProvider( - create: (context) => mockFlavorCubit, - child: WalletLogo( - height: 100, - width: 100, - profileModel: ProfileModel.empty(), - ), - ); - }, + group('ProfileType.custom', () { + testWidgets( + 'displays correct image for ProfileType.custom in development', + (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); + when(() => mockProfileCubit.state).thenReturn( + ProfileState(model: ProfileModel.empty()), + ); + await tester.pumpApp( + Scaffold( + body: Builder( + builder: (context) { + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, + ), + ], + child: const WalletLogo(height: 100, width: 100), + ); + }, + ), ), - ), - ); - await tester.pumpAndSettle(); + ); + await tester.pumpAndSettle(); + + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.appLogoDev); + }); + + testWidgets('displays correct image for ProfileType.custom in staging', + (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.staging); + when(() => mockProfileCubit.state).thenReturn( + ProfileState(model: ProfileModel.empty()), + ); + await tester.pumpApp( + Scaffold( + body: Builder( + builder: (context) { + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, + ), + ], + child: const WalletLogo(height: 100, width: 100), + ); + }, + ), + ), + ); + await tester.pumpAndSettle(); - expect(find.byType(Image), findsOneWidget); + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.appLogoStage); + }); + + testWidgets('displays correct image for ProfileType.custom in production', + (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.production); + when(() => mockProfileCubit.state).thenReturn( + ProfileState(model: ProfileModel.empty()), + ); + await tester.pumpApp( + Scaffold( + body: Builder( + builder: (context) { + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, + ), + ], + child: const WalletLogo(height: 100, width: 100), + ); + }, + ), + ), + ); + await tester.pumpAndSettle(); + + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.appLogo); + }); }); testWidgets('displays correct image for ProfileType.dutch in development', (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); + when(() => mockProfileCubit.state).thenReturn( + ProfileState( + model: ProfileModel.dutch( + polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, + walletType: WalletType.personal, + walletProtectionType: WalletProtectionType.FA2, + isDeveloperMode: true, + clientId: 'clientId', + clientSecret: 'clientSecret', + ), + ), + ); await tester.pumpApp( Scaffold( body: Builder( builder: (context) { - return BlocProvider( - create: (context) => mockFlavorCubit, - child: WalletLogo( - height: 100, - width: 100, - profileModel: ProfileModel.dutch( - polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, - walletType: WalletType.personal, - walletProtectionType: WalletProtectionType.FA2, - isDeveloperMode: true, - clientId: 'clientId', - clientSecret: 'clientSecret', + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, ), - ), + ], + child: const WalletLogo(height: 100, width: 100), ); }, ), @@ -102,29 +208,43 @@ void main() { ); await tester.pumpAndSettle(); - expect(find.byType(Image), findsOneWidget); + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.appLogoDev); }); testWidgets('displays correct image for ProfileType.ebsiV3 in development', (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); + when(() => mockProfileCubit.state).thenReturn( + ProfileState( + model: ProfileModel.ebsiV3( + polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, + walletType: WalletType.personal, + walletProtectionType: WalletProtectionType.FA2, + isDeveloperMode: true, + clientId: 'clientId', + clientSecret: 'clientSecret', + ), + ), + ); await tester.pumpApp( Scaffold( body: Builder( builder: (context) { - return BlocProvider( - create: (context) => mockFlavorCubit, - child: WalletLogo( - height: 100, - width: 100, - profileModel: ProfileModel.ebsiV3( - polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, - walletType: WalletType.personal, - walletProtectionType: WalletProtectionType.FA2, - isDeveloperMode: true, - clientId: 'clientId', - clientSecret: 'clientSecret', + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, ), - ), + ], + child: const WalletLogo(height: 100, width: 100), ); }, ), @@ -132,31 +252,45 @@ void main() { ); await tester.pumpAndSettle(); - expect(find.byType(Image), findsOneWidget); + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.ebsiLogo); }); testWidgets( 'displays correct image for ' 'ProfileType.owfBaselineProfile in development', (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); + when(() => mockProfileCubit.state).thenReturn( + ProfileState( + model: ProfileModel.owfBaselineProfile( + polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, + walletType: WalletType.personal, + walletProtectionType: WalletProtectionType.FA2, + isDeveloperMode: true, + clientId: 'clientId', + clientSecret: 'clientSecret', + ), + ), + ); await tester.pumpApp( Scaffold( body: Builder( builder: (context) { - return BlocProvider( - create: (context) => mockFlavorCubit, - child: WalletLogo( - height: 100, - width: 100, - profileModel: ProfileModel.owfBaselineProfile( - polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, - walletType: WalletType.personal, - walletProtectionType: WalletProtectionType.FA2, - isDeveloperMode: true, - clientId: 'clientId', - clientSecret: 'clientSecret', + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, ), - ), + ], + child: const WalletLogo(height: 100, width: 100), ); }, ), @@ -164,53 +298,67 @@ void main() { ); await tester.pumpAndSettle(); - expect(find.byType(Image), findsOneWidget); + final imageFinder = find.byType(Image); + expect(imageFinder, findsOneWidget); + + final Image image = tester.widget(imageFinder); + final AssetImage imageProvider = image.image as AssetImage; + expect(imageProvider.assetName, ImageStrings.owfBaselineProfileLogo); }); testWidgets( 'displays correct image for ProfileType.enterprise in development', (WidgetTester tester) async { + when(() => mockFlavorCubit.state).thenReturn(FlavorMode.development); + when(() => mockProfileCubit.state).thenReturn( + ProfileState( + model: ProfileModel( + polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, + walletType: WalletType.personal, + walletProtectionType: WalletProtectionType.pinCode, + isDeveloperMode: false, + profileType: ProfileType.enterprise, + profileSetting: ProfileSetting( + blockchainOptions: BlockchainOptions.initial(), + discoverCardsOptions: DiscoverCardsOptions.initial(), + generalOptions: GeneralOptions( + walletType: WalletAppType.altme, + companyName: '', + companyWebsite: '', + companyLogo: 'https://www.demo.com', + tagLine: '', + splashScreenTitle: '', + profileName: '', + profileVersion: '', + published: DateTime.now(), + profileId: '', + customerPlan: '', + primaryColor: '', + ), + helpCenterOptions: HelpCenterOptions.initial(), + selfSovereignIdentityOptions: + SelfSovereignIdentityOptions.initial(), + settingsMenu: SettingsMenu.initial(), + version: '', + walletSecurityOptions: WalletSecurityOptions.initial(), + ), + ), + ), + ); await tester.pumpApp( Scaffold( body: Builder( builder: (context) { - return BlocProvider( - create: (context) => mockFlavorCubit, - child: WalletLogo( - height: 100, - width: 100, - profileModel: ProfileModel( - polygonIdNetwork: PolygonIdNetwork.PolygonMainnet, - walletType: WalletType.personal, - walletProtectionType: WalletProtectionType.pinCode, - isDeveloperMode: false, - profileType: ProfileType.enterprise, - profileSetting: ProfileSetting( - blockchainOptions: BlockchainOptions.initial(), - discoverCardsOptions: DiscoverCardsOptions.initial(), - generalOptions: GeneralOptions( - walletType: WalletAppType.altme, - companyName: '', - companyWebsite: '', - companyLogo: 'https://www.demo.com', - tagLine: '', - splashScreenTitle: '', - profileName: '', - profileVersion: '', - published: DateTime.now(), - profileId: '', - customerPlan: '', - primaryColor: '', - ), - helpCenterOptions: HelpCenterOptions.initial(), - selfSovereignIdentityOptions: - SelfSovereignIdentityOptions.initial(), - settingsMenu: SettingsMenu.initial(), - version: '', - walletSecurityOptions: WalletSecurityOptions.initial(), - ), + return MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => mockFlavorCubit, + ), + BlocProvider( + create: (context) => mockProfileCubit, ), - ), + ], + child: const WalletLogo(height: 100, width: 100), ); }, ), From 8a0833efd1373616d27bdb17050102d9957b5c66 Mon Sep 17 00:00:00 2001 From: hawkbee <49282360+hawkbee1@users.noreply.github.com> Date: Fri, 28 Jun 2024 12:11:58 +0200 Subject: [PATCH 4/6] Hugo design (#2751) * Talao logo #2744 * almost finished * design improvement * better design * last design changes * Altme flash when switch #2746 * solving token send error for amount less than 1 --- lib/app/shared/constants/sizes.dart | 2 +- .../shared/widget/base/background_card.dart | 4 +- lib/app/shared/widget/base/page.dart | 4 +- .../widget/button/my_elevated_button.dart | 14 +- .../widget/button/my_outlined_button.dart | 10 +- lib/app/shared/widget/custom_app_bar.dart | 11 +- .../shared/widget/custom_listtile_card.dart | 15 +- .../shared/widget/divider_for_radio_list.dart | 18 ++ lib/app/shared/widget/wallet_logo.dart | 1 - .../view/choose_add_account_method_page.dart | 2 +- .../view/crypto_bottom_sheet_view.dart | 12 +- .../widgets/crypto_accont_item.dart | 3 +- .../discover/view/discover_tab_page.dart | 8 +- .../view/manage_accounts_page.dart | 46 ++-- .../widgets/manage_accounts_item.dart | 234 +++++++++--------- .../widgets/reveal_private_key_button.dart | 8 +- .../widgets/see_address_button.dart | 13 +- .../view/manage_network_page.dart | 71 +++--- .../widgets/network_selector.dart | 29 +-- .../widget/profile_selector_widget.dart | 22 +- .../src/view/check_linkedin_profile.dart | 3 - .../drawer/src/view/drawer_page.dart | 1 - .../src/widgets/drawer_category_item.dart | 6 +- .../drawer/src/widgets/drawer_item.dart | 112 +++++---- .../ssi/backup/src/view/backup_menu.dart | 1 - .../widget/client_authentication_widget.dart | 19 +- .../widget/client_type_widget.dart | 19 +- .../widget/did_key_type_widget.dart | 19 +- .../widget/draft_type_widget.dart | 19 +- .../widget/proof_header_widget.dart | 19 +- .../widget/proof_type_widget.dart | 19 +- .../widget/vc_format_widget.dart | 19 +- .../ssi/restore/src/view/restore_menu.dart | 3 - .../view/trust_framework_page.dart | 26 +- .../widget/language_selector_widget.dart | 26 +- .../widget/theme_selector_widget.dart | 59 +++-- lib/dashboard/home/home/widgets/qr_icon.dart | 14 +- .../home_credential_category_item.dart | 50 ++-- .../view/tab_controller_page.dart | 7 +- .../tab_controller/widgets/tab_bar.dart | 19 +- .../view/confirm_token_transaction_page.dart | 9 +- .../widgets/edit_button.dart | 6 +- .../widgets/transaction_done_dialog.dart | 4 - .../cubit/token_amount_calculator_cubit.dart | 10 +- .../widgets/max_button.dart | 2 +- .../widgets/token_amount_calculator.dart | 4 +- .../widgets/token_select_box.dart | 2 +- .../widgets/transaction_item.dart | 3 +- .../tokens/token_page/widgets/token_item.dart | 5 +- .../widgets/account_select_box_view.dart | 85 +++---- .../widgets/withdrawal_address_input.dart | 76 +++--- .../view/missing_credentials_page.dart | 12 +- lib/dashboard/src/view/dashboard_page.dart | 2 +- .../src/widgets/bottom_bar_decoration.dart | 11 +- .../src/widgets/bottom_bar_item.dart | 9 +- .../view/import_from_wallet_page.dart | 5 +- .../view/import_wallet_page.dart | 6 +- .../widgets/wallet_type_item.dart | 7 +- lib/l10n/arb/app_en.arb | 4 +- .../view/onboarding_gen_phrase.dart | 18 +- lib/onboarding/starter/view/starter_page.dart | 24 +- .../wallet_ready/view/wallet_ready_page.dart | 7 +- lib/onboarding/widgets/m_stepper.dart | 4 +- lib/onboarding/widgets/protect_widget.dart | 2 +- lib/pin_code/view/confirm_pin_code_page.dart | 2 +- lib/pin_code/view/pin_code_page.dart | 2 +- lib/pin_code/widgets/pin_code_widget.dart | 4 +- lib/splash/widgets/subtitle_text.dart | 4 +- lib/theme/app_theme/app_theme.dart | 3 - .../widget/custom_listtile_card_test.dart | 24 -- 70 files changed, 629 insertions(+), 714 deletions(-) create mode 100644 lib/app/shared/widget/divider_for_radio_list.dart diff --git a/lib/app/shared/constants/sizes.dart b/lib/app/shared/constants/sizes.dart index 30d701743..63d4737e5 100644 --- a/lib/app/shared/constants/sizes.dart +++ b/lib/app/shared/constants/sizes.dart @@ -23,7 +23,7 @@ abstract class Sizes { ///borderRadius static const double credentialBorderRadius = 16; static const double smallRadius = 8; - static const double normalRadius = 12; + static const double normalRadius = 10; static const double largeRadius = 18; static const double credentialAspectRatio = 500 / 300; diff --git a/lib/app/shared/widget/base/background_card.dart b/lib/app/shared/widget/base/background_card.dart index 4d5047c65..5989e427e 100644 --- a/lib/app/shared/widget/base/background_card.dart +++ b/lib/app/shared/widget/base/background_card.dart @@ -9,6 +9,7 @@ class BackgroundCard extends StatelessWidget { this.color, this.height, this.width, + this.borderRadius = 10, }); final Widget? child; @@ -17,6 +18,7 @@ class BackgroundCard extends StatelessWidget { final Color? color; final double? height; final double? width; + final double borderRadius; @override Widget build(BuildContext context) { @@ -27,7 +29,7 @@ class BackgroundCard extends StatelessWidget { width: width, decoration: BoxDecoration( color: color ?? Theme.of(context).colorScheme.surfaceContainer, - borderRadius: const BorderRadius.all(Radius.circular(15)), + borderRadius: BorderRadius.all(Radius.circular(borderRadius)), ), child: child, ); diff --git a/lib/app/shared/widget/base/page.dart b/lib/app/shared/widget/base/page.dart index f65dee2a6..2e9e20603 100644 --- a/lib/app/shared/widget/base/page.dart +++ b/lib/app/shared/widget/base/page.dart @@ -171,8 +171,8 @@ class _BasePageState extends State with WidgetsBindingObserver { floatingActionButton: widget.floatingActionButton, floatingActionButtonLocation: widget.floatingActionButtonLocation, extendBody: widget.extendBelow ?? false, - backgroundColor: widget.backgroundColor ?? - Theme.of(context).colorScheme.surface, + backgroundColor: + widget.backgroundColor ?? Theme.of(context).colorScheme.surface, appBar: (widget.title == null && widget.titleLeading == null && widget.titleTrailing == null) diff --git a/lib/app/shared/widget/button/my_elevated_button.dart b/lib/app/shared/widget/button/my_elevated_button.dart index 7b909d6d6..90b94914d 100644 --- a/lib/app/shared/widget/button/my_elevated_button.dart +++ b/lib/app/shared/widget/button/my_elevated_button.dart @@ -56,13 +56,14 @@ class MyElevatedButton extends StatelessWidget { text.toUpperCase(), style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.bold, + color: Theme.of(context).colorScheme.onPrimaryContainer, ), ), ) : ElevatedButton.icon( icon: ColorFiltered( colorFilter: ColorFilter.mode( - textColor ?? Theme.of(context).textTheme.titleLarge!.color!, + textColor ?? Theme.of(context).colorScheme.onPrimaryContainer, BlendMode.srcIn, ), child: icon, @@ -80,6 +81,7 @@ class MyElevatedButton extends StatelessWidget { text.toUpperCase(), style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.bold, + color: Theme.of(context).colorScheme.onPrimaryContainer, ), ), ), @@ -103,7 +105,15 @@ ButtonStyle elevatedStyleFrom({ backgroundColor: WidgetStateProperty.all( onPressed == null ? Theme.of(context).colorScheme.outline - : backgroundColor ?? Theme.of(context).colorScheme.secondaryContainer, + : backgroundColor ?? Theme.of(context).colorScheme.primaryContainer, + ), + side: WidgetStatePropertyAll( + BorderSide( + color: onPressed == null + ? Theme.of(context).colorScheme.outline + : Theme.of(context).colorScheme.primaryContainer, + width: 2, + ), ), shape: WidgetStateProperty.all( RoundedRectangleBorder( diff --git a/lib/app/shared/widget/button/my_outlined_button.dart b/lib/app/shared/widget/button/my_outlined_button.dart index ef0fd208e..f21838feb 100644 --- a/lib/app/shared/widget/button/my_outlined_button.dart +++ b/lib/app/shared/widget/button/my_outlined_button.dart @@ -63,10 +63,10 @@ class MyOutlinedButton extends StatelessWidget { color: onPressed == null ? Theme.of(context) .colorScheme - .onSurface + .inverseSurface .withOpacity(0.12) : textColor ?? - Theme.of(context).colorScheme.secondaryContainer, + Theme.of(context).colorScheme.inverseSurface, ), ), ) @@ -118,11 +118,11 @@ ButtonStyle outlinedStyleFrom({ return OutlinedButton.styleFrom( padding: EdgeInsets.symmetric(vertical: verticalSpacing), elevation: elevation, - backgroundColor: backgroundColor ?? Theme.of(context).colorScheme.surface, + backgroundColor: backgroundColor ?? Colors.transparent, side: BorderSide( color: onPressed == null - ? Theme.of(context).colorScheme.onSurface.withOpacity(0.12) - : borderColor ?? Theme.of(context).colorScheme.secondaryContainer, + ? Theme.of(context).colorScheme.inverseSurface.withOpacity(0.12) + : borderColor ?? Theme.of(context).colorScheme.inverseSurface, width: 2, ), shape: RoundedRectangleBorder( diff --git a/lib/app/shared/widget/custom_app_bar.dart b/lib/app/shared/widget/custom_app_bar.dart index d2abd3f1b..cbda62bc4 100644 --- a/lib/app/shared/widget/custom_app_bar.dart +++ b/lib/app/shared/widget/custom_app_bar.dart @@ -26,7 +26,12 @@ class CustomAppBar extends PreferredSize { color: Theme.of(context).colorScheme.surface, child: SafeArea( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), + padding: const EdgeInsets.fromLTRB( + 10, + 0, + 15, + 0, + ), child: Stack( alignment: Alignment.topCenter, children: [ @@ -50,7 +55,9 @@ class CustomAppBar extends PreferredSize { title ?? '', maxLines: 2, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineSmall, + style: Theme.of(context).textTheme.headlineSmall!.copyWith( + fontWeight: FontWeight.bold, + ), ), ), ], diff --git a/lib/app/shared/widget/custom_listtile_card.dart b/lib/app/shared/widget/custom_listtile_card.dart index 3c3abb2ef..f179609cb 100644 --- a/lib/app/shared/widget/custom_listtile_card.dart +++ b/lib/app/shared/widget/custom_listtile_card.dart @@ -8,7 +8,6 @@ class CustomListTileCard extends StatelessWidget { required this.title, required this.subTitle, required this.imageAssetPath, - this.recommended = false, this.onTap, }); @@ -16,7 +15,6 @@ class CustomListTileCard extends StatelessWidget { final String subTitle; final String imageAssetPath; final VoidCallback? onTap; - final bool recommended; @override Widget build(BuildContext context) { @@ -27,8 +25,8 @@ class CustomListTileCard extends StatelessWidget { Radius.circular(Sizes.normalRadius), ), ), - contentPadding: const EdgeInsets.all(Sizes.spaceNormal), - tileColor: Theme.of(context).colorScheme.secondaryContainer, + contentPadding: const EdgeInsets.all(Sizes.spaceSmall), + tileColor: Theme.of(context).colorScheme.surfaceContainer, title: Row( children: [ Expanded( @@ -40,14 +38,6 @@ class CustomListTileCard extends StatelessWidget { ), ), const SizedBox(width: 10), - if (recommended) - const Icon( - Icons.thumb_up, - // size: 38, - color: Colors.white, - ) - else - const SizedBox.shrink(), ], ), subtitle: Text( @@ -59,7 +49,6 @@ class CustomListTileCard extends StatelessWidget { imageAssetPath, width: Sizes.icon5x, height: Sizes.icon5x, - fit: BoxFit.fitHeight, ), ); } diff --git a/lib/app/shared/widget/divider_for_radio_list.dart b/lib/app/shared/widget/divider_for_radio_list.dart new file mode 100644 index 000000000..cd900316a --- /dev/null +++ b/lib/app/shared/widget/divider_for_radio_list.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +class DividerForRadioList extends StatelessWidget { + const DividerForRadioList({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Divider( + height: 0, + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12), + ), + ); + } +} diff --git a/lib/app/shared/widget/wallet_logo.dart b/lib/app/shared/widget/wallet_logo.dart index 0d27d05d2..6e1c1d75c 100644 --- a/lib/app/shared/widget/wallet_logo.dart +++ b/lib/app/shared/widget/wallet_logo.dart @@ -22,7 +22,6 @@ class WalletLogo extends StatelessWidget { builder: (context, state) { final FlavorCubit flavorCubit = context.read(); String image = ''; - final profileModel = state.model; switch (profileModel.profileType) { diff --git a/lib/dashboard/add_account/choose_method/view/choose_add_account_method_page.dart b/lib/dashboard/add_account/choose_method/view/choose_add_account_method_page.dart index be62ca398..1356490b0 100644 --- a/lib/dashboard/add_account/choose_method/view/choose_add_account_method_page.dart +++ b/lib/dashboard/add_account/choose_method/view/choose_add_account_method_page.dart @@ -49,7 +49,7 @@ class ChooseAddAccountMethodView extends StatelessWidget { Navigator.of(context).push(CreateAccountStep1Page.route()); }, ), - const SizedBox(height: Sizes.spaceLarge), + const SizedBox(height: Sizes.spaceSmall), CustomListTileCard( title: l10n.importAccount, subTitle: l10n.importAccountDescription, diff --git a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart index e1b13b484..2ee2efcbd 100644 --- a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart +++ b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart @@ -117,12 +117,14 @@ class _CryptoBottomSheetPageState extends State { Row( mainAxisSize: MainAxisSize.min, children: [ - Icon( - Icons.account_balance_wallet_rounded, - size: Sizes.icon2x, - color: Theme.of(context).colorScheme.inversePrimary, + SizedBox( + width: 48, + child: Icon( + Icons.account_balance_wallet_rounded, + size: Sizes.icon2x, + color: Theme.of(context).colorScheme.primary, + ), ), - const SizedBox(width: Sizes.spaceXSmall), Text( l10n.selectAccount, style: Theme.of(context).textTheme.titleMedium, diff --git a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/widgets/crypto_accont_item.dart b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/widgets/crypto_accont_item.dart index 1b774c0ce..51ffb1809 100644 --- a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/widgets/crypto_accont_item.dart +++ b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/widgets/crypto_accont_item.dart @@ -65,7 +65,7 @@ class CryptoAccountItem extends StatelessWidget { child: Icon( Icons.edit, size: 20, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.onSurface, ), ), const SizedBox(width: Sizes.spaceXSmall), @@ -101,6 +101,7 @@ class CryptoAccountItem extends StatelessWidget { IconStrings.copy, width: Sizes.icon, height: Sizes.icon, + color: Theme.of(context).colorScheme.onSurface, ), ), const SizedBox(width: Sizes.spaceSmall), diff --git a/lib/dashboard/discover/view/discover_tab_page.dart b/lib/dashboard/discover/view/discover_tab_page.dart index 9c63e0c96..824989b11 100644 --- a/lib/dashboard/discover/view/discover_tab_page.dart +++ b/lib/dashboard/discover/view/discover_tab_page.dart @@ -51,8 +51,12 @@ class _DiscoverTabPageViewState extends State mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: - const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall), + padding: const EdgeInsets.fromLTRB( + Sizes.spaceSmall, + Sizes.spaceSmall, + Sizes.spaceSmall, + 0, + ), child: TabBar( dividerColor: Colors.transparent, controller: _tabController, diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart index 9b3b09c4d..2b85a3bf0 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart @@ -102,22 +102,20 @@ class _ManageAccountsPageState extends State { titleAlignment: Alignment.topCenter, scrollView: false, titleLeading: const BackLeadingButton(), - body: BackgroundCard( - height: double.infinity, - width: double.infinity, - padding: const EdgeInsets.all(Sizes.spaceSmall), - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - ListView.builder( - itemCount: state.cryptoAccount.data.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, i) { - return ManageAccountsItem( + body: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + ListView.builder( + itemCount: state.cryptoAccount.data.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, i) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: ManageAccountsItem( cryptoAccountData: state.cryptoAccount.data[i], listIndex: i, onPressed: () { @@ -126,14 +124,14 @@ class _ManageAccountsPageState extends State { .setCurrentWalletAccount(i); }, onEditButtonPressed: () => _edit(i), - ); - }, - ), - AddAccountButton( - onPressed: onAddAccountPressed, - ), - ], - ), + ), + ); + }, + ), + AddAccountButton( + onPressed: onAddAccountPressed, + ), + ], ), ), ); 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 b409e4606..9eb615476 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 @@ -32,140 +32,134 @@ class ManageAccountsItem extends StatelessWidget { ? '${l10n.cryptoAccount} ${listIndex + 1}' : cryptoAccountData.name; - return Container( - margin: const EdgeInsets.only(bottom: Sizes.spaceSmall), - padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, - borderRadius: const BorderRadius.all( - Radius.circular(Sizes.normalRadius), - ), - border: Border.all( - color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12), - width: 0.25, - ), - ), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ListTile( - onTap: onPressed, - contentPadding: EdgeInsets.zero, - horizontalTitleGap: 0, - title: Row( - children: [ - Image.asset( - cryptoAccountData.blockchainType.icon, - width: Sizes.icon, - ), - const SizedBox(width: Sizes.spaceXSmall), - Flexible( - child: MyText( - accountName, - maxLines: 1, - minFontSize: 12, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.headlineSmall, - ), - ), - const SizedBox(width: Sizes.spaceXSmall), - InkWell( - onTap: onEditButtonPressed, - child: Icon( - Icons.edit, - size: 20, - color: Theme.of(context).colorScheme.onPrimary, - ), - ), - const SizedBox(width: Sizes.spaceXSmall), - if (cryptoAccountData.isImported) const ImportedTag(), - ], - ), - subtitle: Padding( - padding: const EdgeInsets.symmetric(vertical: Sizes.spaceXSmall), - child: Row( + return BackgroundCard( + child: Container( + margin: const EdgeInsets.only(bottom: Sizes.spaceSmall), + padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ListTile( + onTap: onPressed, + contentPadding: EdgeInsets.zero, + horizontalTitleGap: 0, + title: Row( children: [ - Expanded( + Image.asset( + cryptoAccountData.blockchainType.icon, + width: Sizes.icon, + ), + const SizedBox(width: Sizes.spaceXSmall), + Flexible( child: MyText( - walletAddressExtracted, - style: Theme.of(context).textTheme.bodyMedium, + accountName, + maxLines: 1, + minFontSize: 12, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.headlineSmall, ), ), - const SizedBox(width: Sizes.spaceSmall), + const SizedBox(width: Sizes.spaceXSmall), InkWell( - onTap: () async { - await Clipboard.setData( - ClipboardData( - text: walletAddressExtracted, - ), - ); - AlertMessage.showStateMessage( - context: context, - stateMessage: StateMessage.success( - stringMessage: l10n.copiedToClipboard, - ), - ); - }, - child: Image.asset( - IconStrings.copy, - width: Sizes.icon, - height: Sizes.icon, + onTap: onEditButtonPressed, + child: Icon( + Icons.edit, + size: 20, + color: Theme.of(context).colorScheme.onSurface, ), ), - const SizedBox(width: Sizes.spaceSmall), + const SizedBox(width: Sizes.spaceXSmall), + if (cryptoAccountData.isImported) const ImportedTag(), ], ), - ), - ), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - SeeAddressButton( - onTap: () { - Navigator.of(context).push( - AccountPublicAddressPage.route( - accountName: accountName, - accountAddress: cryptoAccountData.walletAddress, + subtitle: Padding( + padding: + const EdgeInsets.symmetric(vertical: Sizes.spaceXSmall), + child: Row( + children: [ + Expanded( + child: MyText( + walletAddressExtracted, + style: Theme.of(context).textTheme.bodyMedium, + ), ), - ); - }, - ), - const SizedBox(width: Sizes.spaceSmall), - RevealPrivateKeyButton( - onTap: () async { - final confirm = await showDialog( - context: context, - builder: (context) => ConfirmDialog( - title: l10n.warningDialogTitle, - subtitle: l10n.accountPrivateKeyAlert, - yes: l10n.showDialogYes, - no: l10n.showDialogNo, - ), - ) ?? - false; - - if (confirm) { - await securityCheck( - context: context, - localAuthApi: LocalAuthApi(), - onSuccess: () { - Navigator.of(context).push( - AccountPrivateKeyPage.route( - privateKey: cryptoAccountData.secretKey, + const SizedBox(width: Sizes.spaceSmall), + InkWell( + onTap: () async { + await Clipboard.setData( + ClipboardData( + text: walletAddressExtracted, + ), + ); + AlertMessage.showStateMessage( + context: context, + stateMessage: StateMessage.success( + stringMessage: l10n.copiedToClipboard, ), ); }, - ); - } - }, + child: Image.asset( + IconStrings.copy, + width: Sizes.icon, + height: Sizes.icon, + color: Theme.of(context).colorScheme.onSurface, + ), + ), + const SizedBox(width: Sizes.spaceSmall), + ], + ), ), - ], - ), - const SizedBox( - height: Sizes.spaceSmall, - ), - ], + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + SeeAddressButton( + onTap: () { + Navigator.of(context).push( + AccountPublicAddressPage.route( + accountName: accountName, + accountAddress: cryptoAccountData.walletAddress, + ), + ); + }, + ), + const SizedBox(width: Sizes.spaceSmall), + RevealPrivateKeyButton( + onTap: () async { + final confirm = await showDialog( + context: context, + builder: (context) => ConfirmDialog( + title: l10n.warningDialogTitle, + subtitle: l10n.accountPrivateKeyAlert, + yes: l10n.showDialogYes, + no: l10n.showDialogNo, + ), + ) ?? + false; + + if (confirm) { + await securityCheck( + context: context, + localAuthApi: LocalAuthApi(), + onSuccess: () { + Navigator.of(context).push( + AccountPrivateKeyPage.route( + privateKey: cryptoAccountData.secretKey, + ), + ); + }, + ); + } + }, + ), + ], + ), + const SizedBox( + height: Sizes.spaceSmall, + ), + ], + ), ), ); } diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/reveal_private_key_button.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/reveal_private_key_button.dart index 28388bc09..8368b8cf6 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/reveal_private_key_button.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/reveal_private_key_button.dart @@ -29,11 +29,13 @@ class RevealPrivateKeyButton extends StatelessWidget { Image.asset( IconStrings.lockCircle, width: Sizes.icon, - color: Colors.white, + color: Theme.of(context).colorScheme.onSurface, ), - MyText( + Text( l10n.revealPrivateKey.toUpperCase(), - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + color: Theme.of(context).colorScheme.onSurface, + ), ), ], ), diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/see_address_button.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/see_address_button.dart index be8be0a42..86cba1cf0 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/see_address_button.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/widgets/see_address_button.dart @@ -17,7 +17,7 @@ class SeeAddressButton extends StatelessWidget { height: 30, padding: const EdgeInsets.all(Sizes.spaceXSmall), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.primaryContainer, borderRadius: const BorderRadius.all( Radius.circular(Sizes.smallRadius), ), @@ -26,17 +26,20 @@ class SeeAddressButton extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, children: [ - const Padding( - padding: EdgeInsets.symmetric(horizontal: Sizes.space2XSmall), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: Sizes.space2XSmall), child: Icon( Icons.remove_red_eye, size: Sizes.iconXSmall, - color: Colors.white, + color: Theme.of(context).colorScheme.onPrimaryContainer, ), ), Text( l10n.seeAddress.toUpperCase(), - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + color: Theme.of(context).colorScheme.onPrimaryContainer, + ), ), ], ), diff --git a/lib/dashboard/drawer/blockchain_settings/manage_network/view/manage_network_page.dart b/lib/dashboard/drawer/blockchain_settings/manage_network/view/manage_network_page.dart index 2fd3ae4d9..2afd80d93 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_network/view/manage_network_page.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_network/view/manage_network_page.dart @@ -30,46 +30,41 @@ class ManageNetworkPage extends StatelessWidget { context.read().state.currentAccount!.blockchainType; final currentNetworkList = blockchainType.networks; - return BackgroundCard( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Center( - child: Text( - l10n.chooseNetWork, - style: Theme.of(context).textTheme.headlineSmall, - ), + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: Text( + l10n.chooseNetWork, + style: Theme.of(context).textTheme.headlineSmall, ), - const SizedBox(height: 15), - ...List.generate( - currentNetworkList.length, - (index) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - NetworkSelector( - network: currentNetworkList[index], - groupValue: state.network, + ), + const SizedBox(height: 15), + ...List.generate( + currentNetworkList.length, + (index) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + NetworkSelector( + network: currentNetworkList[index], + groupValue: state.network, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Divider( + height: 0, + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: Sizes.spaceSmall, - vertical: Sizes.spaceXSmall, - ), - child: Divider( - height: 0.2, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), - ], - ); - }, - ), - ], - ), + ), + ], + ); + }, + ), + ], ); }, ), diff --git a/lib/dashboard/drawer/blockchain_settings/manage_network/widgets/network_selector.dart b/lib/dashboard/drawer/blockchain_settings/manage_network/widgets/network_selector.dart index fbe348bcb..c0ada49b9 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_network/widgets/network_selector.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_network/widgets/network_selector.dart @@ -18,26 +18,21 @@ class NetworkSelector extends StatelessWidget { Widget build(BuildContext context) { return BlocBuilder( builder: (context, state) { - return RadioListTile( - value: network, - groupValue: groupValue, - contentPadding: EdgeInsets.zero, - activeColor: Theme.of(context).colorScheme.onPrimary, - dense: true, - visualDensity: VisualDensity.compact, + return ListTile( + onTap: () async { + await context.read().setNetwork(network); + }, title: Text( - network.title!, - style: Theme.of(context).textTheme.titleMedium, + '${network.title!}\n${network.subTitle!}', + style: Theme.of(context).textTheme.bodyLarge, ), - subtitle: Text( - network.subTitle!, - style: Theme.of(context).textTheme.bodyMedium, + trailing: Icon( + state.network == network + ? Icons.radio_button_checked + : Icons.radio_button_unchecked, + size: Sizes.icon2x, + color: Theme.of(context).colorScheme.primary, ), - onChanged: (BlockchainNetwork? value) async { - if (value != null) { - await context.read().setNetwork(value); - } - }, ); }, ); diff --git a/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart b/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart index 3dcca9c6b..c128eba99 100644 --- a/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart +++ b/lib/dashboard/drawer/profile/widget/profile_selector_widget.dart @@ -66,18 +66,6 @@ class ProfileSelectorWidget extends StatelessWidget { return Column( children: [ - if (index != 0) - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () async { await context @@ -114,6 +102,16 @@ class ProfileSelectorWidget extends StatelessWidget { color: Theme.of(context).colorScheme.primary, ), ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Divider( + height: 0, + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), + ), + ), ], ); }, diff --git a/lib/dashboard/drawer/src/view/check_linkedin_profile.dart b/lib/dashboard/drawer/src/view/check_linkedin_profile.dart index 539fcbed5..57861ea6f 100644 --- a/lib/dashboard/drawer/src/view/check_linkedin_profile.dart +++ b/lib/dashboard/drawer/src/view/check_linkedin_profile.dart @@ -44,9 +44,6 @@ class CheckForLinkedInProfileView extends StatelessWidget { width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, ), - const SizedBox( - height: Sizes.spaceSmall, - ), DrawerItem( title: l10n.scanAndDisplay, onTap: () async { diff --git a/lib/dashboard/drawer/src/view/drawer_page.dart b/lib/dashboard/drawer/src/view/drawer_page.dart index 0af25c4f5..041df1d8f 100644 --- a/lib/dashboard/drawer/src/view/drawer_page.dart +++ b/lib/dashboard/drawer/src/view/drawer_page.dart @@ -60,7 +60,6 @@ class DrawerView extends StatelessWidget { ProfileType.enterprise) ...[ DrawerCategoryItem( title: l10n.updateYourWalletConfigNow, - padding: const EdgeInsets.all(16), onClick: () async { Navigator.of(context).pop(); await context diff --git a/lib/dashboard/drawer/src/widgets/drawer_category_item.dart b/lib/dashboard/drawer/src/widgets/drawer_category_item.dart index b2394b7da..f27033d6f 100644 --- a/lib/dashboard/drawer/src/widgets/drawer_category_item.dart +++ b/lib/dashboard/drawer/src/widgets/drawer_category_item.dart @@ -9,23 +9,21 @@ class DrawerCategoryItem extends StatelessWidget { this.subTitle, this.onClick, this.trailing, - this.padding = const EdgeInsets.all(Sizes.spaceSmall), }); final String title; final String? subTitle; final VoidCallback? onClick; final Widget? trailing; - final EdgeInsetsGeometry padding; @override Widget build(BuildContext context) { return InkWell( onTap: onClick, child: Container( - padding: padding, + padding: const EdgeInsets.all(Sizes.spaceSmall), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.secondaryContainer, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: const BorderRadius.all( Radius.circular(Sizes.normalRadius), ), diff --git a/lib/dashboard/drawer/src/widgets/drawer_item.dart b/lib/dashboard/drawer/src/widgets/drawer_item.dart index 6acad3b22..847b4880d 100644 --- a/lib/dashboard/drawer/src/widgets/drawer_item.dart +++ b/lib/dashboard/drawer/src/widgets/drawer_item.dart @@ -20,44 +20,32 @@ class DrawerItem extends StatelessWidget { @override Widget build(BuildContext context) { - return TransparentInkWell( - onTap: onTap, - child: Container( - padding: const EdgeInsets.all(Sizes.spaceNormal), - margin: const EdgeInsets.all(Sizes.spaceXSmall), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.secondaryContainer, - borderRadius: const BorderRadius.all( - Radius.circular( - Sizes.normalRadius, + return Padding( + padding: const EdgeInsets.all(Sizes.spaceSmall / 2), + child: TransparentInkWell( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(Sizes.spaceSmall), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceContainer, + borderRadius: const BorderRadius.all( + Radius.circular( + Sizes.normalRadius, + ), ), ), - ), - child: SizedBox( - width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: Theme.of(context).textTheme.titleLarge!.copyWith( - color: isDisabled - ? Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.6) - : null, - ), - ), - if (subtitle != null) ...[ - const SizedBox(height: 10), + child: SizedBox( + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Text( - subtitle!, + title, style: Theme.of(context).textTheme.titleMedium!.copyWith( color: isDisabled @@ -66,29 +54,47 @@ class DrawerItem extends StatelessWidget { .onSurface .withOpacity(0.6) : null, + fontWeight: FontWeight.bold, ), ), - const SizedBox(height: 10), + if (subtitle != null) ...[ + const SizedBox(height: Sizes.space2XSmall), + Text( + subtitle!, + style: + Theme.of(context).textTheme.bodyMedium!.copyWith( + color: isDisabled + ? Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.6) + : null, + ), + ), + ], ], - ], - ), - ), - if (trailing != null) - trailing! - else ...[ - const SizedBox(width: 16), - Icon( - Icons.chevron_right, - size: Sizes.icon2x, - color: isDisabled - ? Theme.of(context).colorScheme.onSurface.withOpacity(0.6) - : Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.6), + ), ), + if (trailing != null) + trailing! + else ...[ + const SizedBox(width: 16), + Icon( + Icons.chevron_right, + size: Sizes.icon2x, + color: isDisabled + ? Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.6) + : Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.6), + ), + ], ], - ], + ), ), ), ), diff --git a/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart b/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart index df0d3774c..fe11259ae 100644 --- a/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart +++ b/lib/dashboard/drawer/ssi/backup/src/view/backup_menu.dart @@ -42,7 +42,6 @@ class BackupView extends StatelessWidget { width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, ), - const SizedBox(height: Sizes.spaceSmall), DrawerItem( title: l10n.backupCredential, onTap: () async { diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart index 8fb078117..dd3ad5521 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_authentication_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -30,17 +31,6 @@ class ClientAuthenticationWidget extends StatelessWidget { return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { context.read().updateProfileSetting( @@ -55,9 +45,7 @@ class ClientAuthenticationWidget extends StatelessWidget { ), title: Text( clientAuthenticationType.value, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -66,9 +54,10 @@ class ClientAuthenticationWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList(), ], ); }, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart index a96ba238c..9e1182770 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/client_type_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -25,17 +26,6 @@ class ClientTypeWidget extends StatelessWidget { final clientType = ClientType.values[index]; return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { context.read().updateProfileSetting( @@ -50,9 +40,7 @@ class ClientTypeWidget extends StatelessWidget { ), title: Text( clientType.getTitle, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -61,9 +49,10 @@ class ClientTypeWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList(), ], ); }, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart index f5e513d2e..a6455b491 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/did_key_type_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -29,17 +30,6 @@ class DidKeyTypeWidget extends StatelessWidget { } return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { final customOidc4vcProfile = state.model.profileSetting @@ -78,9 +68,7 @@ class DidKeyTypeWidget extends StatelessWidget { ), title: Text( didKeyType.formattedString, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -89,9 +77,10 @@ class DidKeyTypeWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList(), ], ); }, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart index f535378a1..6232a4434 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -25,17 +26,6 @@ class DraftTypeWidget extends StatelessWidget { final draftType = OIDC4VCIDraftType.values[index]; return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { context.read().updateProfileSetting( @@ -50,9 +40,7 @@ class DraftTypeWidget extends StatelessWidget { ), title: Text( draftType.formattedString, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -61,9 +49,10 @@ class DraftTypeWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList() ], ); }, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart index a1e62c379..40d3f993e 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_header_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -25,17 +26,6 @@ class ProofHeaderWidget extends StatelessWidget { final proofHeaderType = ProofHeaderType.values[index]; return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { context.read().updateProfileSetting( @@ -50,9 +40,7 @@ class ProofHeaderWidget extends StatelessWidget { ), title: Text( proofHeaderType.formattedString, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -61,9 +49,10 @@ class ProofHeaderWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList(), ], ); }, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart index 98af2898d..1adf0cae1 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/proof_type_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -25,17 +26,6 @@ class ProofTypeWidget extends StatelessWidget { final proofType = ProofType.values[index]; return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { context.read().updateProfileSetting( @@ -50,9 +40,7 @@ class ProofTypeWidget extends StatelessWidget { ), title: Text( proofType.formattedString, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -61,9 +49,10 @@ class ProofTypeWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList(), ], ); }, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart index 868cc7e7c..4eeff5dcc 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/vc_format_widget.dart @@ -1,4 +1,5 @@ import 'package:altme/app/app.dart'; +import 'package:altme/app/shared/widget/divider_for_radio_list.dart'; import 'package:altme/dashboard/dashboard.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:flutter/material.dart'; @@ -25,17 +26,6 @@ class VCFormatWidget extends StatelessWidget { final vcFormatType = VCFormatType.values[index]; return Column( children: [ - if (index != 0) - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () { context.read().updateProfileSetting( @@ -50,9 +40,7 @@ class VCFormatWidget extends StatelessWidget { ), title: Text( vcFormatType.vcValue, - style: Theme.of(context).textTheme.bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.onPrimary, - ), + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.model.profileSetting.selfSovereignIdentityOptions @@ -61,9 +49,10 @@ class VCFormatWidget extends StatelessWidget { ? Icons.radio_button_checked : Icons.radio_button_unchecked, size: Sizes.icon2x, - color: Theme.of(context).colorScheme.onPrimary, + color: Theme.of(context).colorScheme.primary, ), ), + const DividerForRadioList(), ], ); }, diff --git a/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart b/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart index 905cd5cdc..d51db8222 100644 --- a/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart +++ b/lib/dashboard/drawer/ssi/restore/src/view/restore_menu.dart @@ -42,9 +42,6 @@ class RestoreView extends StatelessWidget { width: MediaQuery.of(context).size.shortestSide * 0.5, showPoweredBy: true, ), - const SizedBox( - height: Sizes.spaceSmall, - ), DrawerItem( title: l10n.restoreCredential, onTap: () async { diff --git a/lib/dashboard/drawer/ssi/trust_framework/view/trust_framework_page.dart b/lib/dashboard/drawer/ssi/trust_framework/view/trust_framework_page.dart index 4bd2a6878..f09a52878 100644 --- a/lib/dashboard/drawer/ssi/trust_framework/view/trust_framework_page.dart +++ b/lib/dashboard/drawer/ssi/trust_framework/view/trust_framework_page.dart @@ -93,6 +93,17 @@ class TrustFrameworkPage extends StatelessWidget { ); }, ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: Sizes.spaceSmall, + ), + child: Divider( + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), + ), + ), ], ), Padding( @@ -102,12 +113,23 @@ class TrustFrameworkPage extends StatelessWidget { style: Theme.of(context).textTheme.labelMedium, ), ), - const GroupedSection( + GroupedSection( children: [ - IssuerVerifierSelector( + const IssuerVerifierSelector( title: 'EBSI', isChecked: true, ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: Sizes.spaceSmall, + ), + child: Divider( + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), + ), + ), ], ), ], diff --git a/lib/dashboard/drawer/wallet_settings/widget/language_selector_widget.dart b/lib/dashboard/drawer/wallet_settings/widget/language_selector_widget.dart index f3ca26f69..6111908fe 100644 --- a/lib/dashboard/drawer/wallet_settings/widget/language_selector_widget.dart +++ b/lib/dashboard/drawer/wallet_settings/widget/language_selector_widget.dart @@ -55,18 +55,6 @@ class LanguageSelectorWidget extends StatelessWidget { return Column( children: [ - if (index != 0) - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 8), - child: Divider( - height: 0, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), - ), ListTile( onTap: () async { await context @@ -84,9 +72,7 @@ class LanguageSelectorWidget extends StatelessWidget { l10n: l10n, name: languageType.name, ), - style: Theme.of(context) - .textTheme - .bodyLarge + style: Theme.of(context).textTheme.bodyLarge, ), trailing: Icon( state.languageType == languageType @@ -96,6 +82,16 @@ class LanguageSelectorWidget extends StatelessWidget { color: Theme.of(context).colorScheme.primary, ), ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Divider( + height: 0, + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), + ), + ), ], ); }, diff --git a/lib/dashboard/drawer/wallet_settings/widget/theme_selector_widget.dart b/lib/dashboard/drawer/wallet_settings/widget/theme_selector_widget.dart index 8d4fb4e13..e49010673 100644 --- a/lib/dashboard/drawer/wallet_settings/widget/theme_selector_widget.dart +++ b/lib/dashboard/drawer/wallet_settings/widget/theme_selector_widget.dart @@ -85,31 +85,42 @@ class ThemeModeLine extends StatelessWidget { @override Widget build(BuildContext context) { - return ListTile( - onTap: () async { - context.read().switchTheme(themeMode); - }, - shape: const RoundedRectangleBorder( - side: BorderSide( - color: Color(0xFFDDDDEE), - width: 0.5, + return Column( + children: [ + ListTile( + onTap: () async { + context.read().switchTheme(themeMode); + }, + shape: const RoundedRectangleBorder( + side: BorderSide( + color: Color(0xFFDDDDEE), + width: 0.5, + ), + ), + title: Text( + label, + style: Theme.of(context).textTheme.bodyLarge, + ), + trailing: BlocBuilder( + builder: (context, state) { + return Icon( + state.themeMode == themeMode + ? Icons.radio_button_checked + : Icons.radio_button_unchecked, + size: Sizes.icon2x, + color: Theme.of(context).colorScheme.primary, + ); + }, + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Divider( + height: 0, + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12), + ), ), - ), - title: Text( - label, - style: Theme.of(context).textTheme.bodyLarge, - ), - trailing: BlocBuilder( - builder: (context, state) { - return Icon( - state.themeMode == themeMode - ? Icons.radio_button_checked - : Icons.radio_button_unchecked, - size: Sizes.icon2x, - color: Theme.of(context).colorScheme.primary, - ); - }, - ), + ], ); } } diff --git a/lib/dashboard/home/home/widgets/qr_icon.dart b/lib/dashboard/home/home/widgets/qr_icon.dart index a9ddc1adb..56f8c8e62 100644 --- a/lib/dashboard/home/home/widgets/qr_icon.dart +++ b/lib/dashboard/home/home/widgets/qr_icon.dart @@ -42,20 +42,20 @@ class QRIcon extends StatelessWidget { alignment: Alignment.center, children: [ Container( - height: 75, - width: 75, + height: 67, + width: 67, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.onPrimaryContainer, borderRadius: BorderRadius.circular(50), boxShadow: [ BoxShadow( color: Theme.of(context).colorScheme.primary, - blurRadius: 5, + blurRadius: 2, offset: Offset.zero, ), BoxShadow( color: - Theme.of(context).colorScheme.shadow.withOpacity(0.16), + Theme.of(context).colorScheme.shadow.withOpacity(0.2), blurRadius: 12, spreadRadius: -12, offset: Offset.zero, @@ -67,7 +67,7 @@ class QRIcon extends StatelessWidget { height: 60, width: 60, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primaryFixedDim, + color: Theme.of(context).colorScheme.primaryContainer, borderRadius: BorderRadius.circular(50), ), ), @@ -76,7 +76,7 @@ class QRIcon extends StatelessWidget { width: 40, child: ImageIcon( const AssetImage(IconStrings.scan), - color: Theme.of(context).colorScheme.onPrimaryFixedVariant, + color: Theme.of(context).colorScheme.onPrimaryContainer, ), ), ], diff --git a/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_item.dart b/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_item.dart index 6fc517883..2875d8f0b 100644 --- a/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_item.dart +++ b/lib/dashboard/home/tab_bar/credentials/list/widgets/home_credential_category_item.dart @@ -57,30 +57,36 @@ class HomeCredentialCategoryItem extends StatelessWidget { ), ), const SizedBox(height: 14), - GridView.builder( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 14, - mainAxisSpacing: 14, - childAspectRatio: Sizes.credentialAspectRatio, + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 0, ), - itemCount: sortedCredentials.length + 1, - itemBuilder: (_, index) { - if (index == sortedCredentials.length) { - if (credentialCategory == CredentialCategory.pendingCards) { - return Container(); + child: GridView.builder( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 14, + mainAxisSpacing: 14, + childAspectRatio: Sizes.credentialAspectRatio, + ), + itemCount: sortedCredentials.length + 1, + itemBuilder: (_, index) { + if (index == sortedCredentials.length) { + if (credentialCategory == CredentialCategory.pendingCards) { + return Container(); + } + return AddCredentialButton( + credentialCategory: credentialCategory, + ); + } else { + return HomeCredentialItem( + credentialModel: sortedCredentials[index], + ); } - return AddCredentialButton( - credentialCategory: credentialCategory, - ); - } else { - return HomeCredentialItem( - credentialModel: sortedCredentials[index], - ); - } - }, + }, + ), ), ], ), diff --git a/lib/dashboard/home/tab_bar/tab_controller/view/tab_controller_page.dart b/lib/dashboard/home/tab_bar/tab_controller/view/tab_controller_page.dart index b89f20b2b..34faff6b9 100644 --- a/lib/dashboard/home/tab_bar/tab_controller/view/tab_controller_page.dart +++ b/lib/dashboard/home/tab_bar/tab_controller/view/tab_controller_page.dart @@ -48,7 +48,12 @@ class _TabControllerViewState extends State mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall), + padding: const EdgeInsets.fromLTRB( + Sizes.spaceSmall, + Sizes.spaceSmall, + Sizes.spaceSmall, + 0, + ), child: TabBar( dividerColor: Colors.transparent, controller: _tabController, diff --git a/lib/dashboard/home/tab_bar/tab_controller/widgets/tab_bar.dart b/lib/dashboard/home/tab_bar/tab_controller/widgets/tab_bar.dart index 94630a8a8..f715533e7 100644 --- a/lib/dashboard/home/tab_bar/tab_controller/widgets/tab_bar.dart +++ b/lib/dashboard/home/tab_bar/tab_controller/widgets/tab_bar.dart @@ -30,20 +30,19 @@ class MyTab extends StatelessWidget { decoration: BoxDecoration( borderRadius: BorderRadius.circular(Sizes.normalRadius), color: isSelected - ? Theme.of(context).colorScheme.primaryFixedDim - : Theme.of(context).colorScheme.primaryContainer, + ? Theme.of(context).colorScheme.primaryContainer + : Theme.of(context).colorScheme.surfaceContainer, ), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ if (isSelected) - ColorFiltered( - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.primaryFixedDim, - BlendMode.color, - ), - child: Image.asset(icon, height: Sizes.icon), + Image.asset( + icon, + height: Sizes.icon, + colorBlendMode: BlendMode.color, + color: Theme.of(context).colorScheme.primaryContainer, ) else Image.asset(icon, height: Sizes.icon), @@ -55,8 +54,8 @@ class MyTab extends StatelessWidget { maxLines: 1, style: Theme.of(context).textTheme.titleLarge!.copyWith( color: isSelected - ? Theme.of(context).colorScheme.onPrimaryFixedVariant - : Theme.of(context).colorScheme.onPrimaryContainer, + ? Theme.of(context).colorScheme.onPrimaryContainer + : Theme.of(context).colorScheme.inverseSurface, ), overflow: TextOverflow.fade, ), 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 6273a4642..70e56657b 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 @@ -179,14 +179,10 @@ class _ConfirmWithdrawalViewState extends State { style: Theme.of(context).textTheme.titleMedium, ), const SizedBox(height: Sizes.spaceSmall), - MyText( + Text( amountAndSymbol, textAlign: TextAlign.center, - minFontSize: 12, - style: Theme.of(context).textTheme.headlineSmall?.copyWith( - color: Colors.white, - fontWeight: FontWeight.w900, - ), + style: Theme.of(context).textTheme.headlineSmall, ), const SizedBox(height: Sizes.spaceSmall), const FromAccountWidget(isEnabled: false), @@ -224,6 +220,7 @@ class _ConfirmWithdrawalViewState extends State { child: Image.asset( IconStrings.arrowDown, height: Sizes.icon3x, + color: Theme.of(context).colorScheme.onSurface, ), ), ConfirmTransactionDetailsCard( diff --git a/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/edit_button.dart b/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/edit_button.dart index a1101eb02..381131d36 100644 --- a/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/edit_button.dart +++ b/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/edit_button.dart @@ -18,14 +18,16 @@ class EditButton extends StatelessWidget { horizontal: Sizes.spaceXSmall, ), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.primaryContainer, borderRadius: const BorderRadius.all( Radius.circular(5), ), ), child: Text( l10n.edit, - style: Theme.of(context).textTheme.labelLarge, + style: Theme.of(context).textTheme.labelLarge!.copyWith( + color: Theme.of(context).colorScheme.onPrimaryContainer, + ), ), ), ); diff --git a/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/transaction_done_dialog.dart b/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/transaction_done_dialog.dart index 7ceec06ec..c63dffcac 100644 --- a/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/transaction_done_dialog.dart +++ b/lib/dashboard/home/tab_bar/tokens/confirm_token_transaction/widgets/transaction_done_dialog.dart @@ -102,10 +102,6 @@ class TransactionDoneDialog extends StatelessWidget { const SizedBox(height: Sizes.spaceSmall), MyElevatedButton( text: l10n.done, - verticalSpacing: 18, - fontSize: 18, - borderRadius: 20, - backgroundColor: Theme.of(context).colorScheme.primary, onPressed: () { Navigator.of(context).pop(); onDoneButtonClick?.call(); diff --git a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/cubit/token_amount_calculator_cubit.dart b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/cubit/token_amount_calculator_cubit.dart index 9a56cbf61..d3a466144 100644 --- a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/cubit/token_amount_calculator_cubit.dart +++ b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/cubit/token_amount_calculator_cubit.dart @@ -23,12 +23,12 @@ class TokenAmountCalculatorCubit extends Cubit { Decimal validAmount = Decimal.parse('0'); String insertedAmount = ''; try { - if (amount.isEmpty || - amount == '0' || - amount == '0.0' || - amount == '00') { + if (amount.isEmpty || amount == '0' || amount == '00') { validAmount = Decimal.parse('0'); - insertedAmount = ''; + insertedAmount = '0'; + } else if (amount.isEmpty || amount == '.') { + validAmount = Decimal.parse('0.'); + insertedAmount = '0.'; } else { insertedAmount = amount.replaceAll(',', ''); final bool isValid = diff --git a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/max_button.dart b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/max_button.dart index 394180775..6cd87a17b 100644 --- a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/max_button.dart +++ b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/max_button.dart @@ -18,7 +18,7 @@ class MaxButton extends StatelessWidget { horizontal: Sizes.spaceSmall, ), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.primaryContainer, borderRadius: const BorderRadius.all( Radius.circular(5), ), diff --git a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_amount_calculator.dart b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_amount_calculator.dart index 9fe4e0fa5..ac1e5be8f 100644 --- a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_amount_calculator.dart +++ b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_amount_calculator.dart @@ -114,7 +114,6 @@ class _TokenAmountCalculatorPageState extends State { selectionControls: _selectionControls, controller: amountController, style: Theme.of(context).textTheme.titleLarge?.copyWith( - color: Colors.white, fontWeight: FontWeight.w600, ), maxLines: 1, @@ -161,7 +160,6 @@ class _TokenAmountCalculatorPageState extends State { suffixText: widget.selectedToken.symbol, suffixStyle: Theme.of(context).textTheme.titleLarge?.copyWith( - color: Colors.white, fontWeight: FontWeight.w900, ), ), @@ -225,7 +223,7 @@ class _TokenAmountCalculatorPageState extends State { icon: Image.asset( IconStrings.keyboardDelete, width: Sizes.icon2x, - color: Colors.white, + color: Theme.of(context).colorScheme.onSurface, ), allowAction: true, onLongPress: (_) { diff --git a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_select_box.dart b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_select_box.dart index c5f504386..d0e29ae9b 100644 --- a/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_select_box.dart +++ b/lib/dashboard/home/tab_bar/tokens/insert_withdrawal_amount/widgets/token_select_box.dart @@ -117,7 +117,7 @@ class _TokenSelectBoxItem extends StatelessWidget { Icon( Icons.keyboard_arrow_down_outlined, size: Sizes.icon, - color: Theme.of(context).colorScheme.inversePrimary, + color: Theme.of(context).colorScheme.onSurface, ), const Spacer(flex: 1), MyText( diff --git a/lib/dashboard/home/tab_bar/tokens/send_receive_home/widgets/transaction_item.dart b/lib/dashboard/home/tab_bar/tokens/send_receive_home/widgets/transaction_item.dart index f627f255c..4c127851b 100644 --- a/lib/dashboard/home/tab_bar/tokens/send_receive_home/widgets/transaction_item.dart +++ b/lib/dashboard/home/tab_bar/tokens/send_receive_home/widgets/transaction_item.dart @@ -80,6 +80,7 @@ class TransactionItem extends StatelessWidget { : IconStrings.receive, width: Sizes.icon, height: Sizes.icon, + color: Theme.of(context).colorScheme.onSurface, ), const SizedBox( width: Sizes.space2XSmall, @@ -103,7 +104,7 @@ class TransactionItem extends StatelessWidget { operationModel.status, style: Theme.of(context).textTheme.titleSmall?.copyWith( color: operationModel.status.toLowerCase() == 'applied' - ? Theme.of(context).colorScheme.onTertiary + ? Theme.of(context).colorScheme.secondary : operationModel.status.toLowerCase() == 'failed' || operationModel.status.toLowerCase() == 'backtracked' diff --git a/lib/dashboard/home/tab_bar/tokens/token_page/widgets/token_item.dart b/lib/dashboard/home/tab_bar/tokens/token_page/widgets/token_item.dart index 2278d90f5..52e56acba 100644 --- a/lib/dashboard/home/tab_bar/tokens/token_page/widgets/token_item.dart +++ b/lib/dashboard/home/tab_bar/tokens/token_page/widgets/token_item.dart @@ -18,13 +18,14 @@ class TokenItem extends StatelessWidget { return Padding( padding: const EdgeInsets.only(bottom: 10), child: BackgroundCard( - color: Theme.of(context).colorScheme.surface.withOpacity(0.07), padding: const EdgeInsets.symmetric(horizontal: 10), child: ListTile( contentPadding: EdgeInsets.zero, minVerticalPadding: 0, leading: token.iconUrl == null - ? const CircleAvatar() + ? const CircleAvatar( + backgroundColor: Colors.transparent, + ) : CachedImageFromNetwork( token.iconUrl!, width: Sizes.tokenLogoSize, diff --git a/lib/dashboard/home/tab_bar/tokens/widgets/account_select_box_view.dart b/lib/dashboard/home/tab_bar/tokens/widgets/account_select_box_view.dart index 419cbf144..e084c02a2 100644 --- a/lib/dashboard/home/tab_bar/tokens/widgets/account_select_box_view.dart +++ b/lib/dashboard/home/tab_bar/tokens/widgets/account_select_box_view.dart @@ -37,57 +37,46 @@ class AccountSelectBoxView extends StatelessWidget { onPressed: isEnabled ? null : null, ) else - Theme( - data: Theme.of(context).copyWith( - unselectedWidgetColor: Theme.of(context).colorScheme.onPrimary, - dividerColor: Theme.of(context).colorScheme.surface, - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - colorScheme: ColorScheme.dark( - primary: Theme.of(context).colorScheme.onPrimary, - ), + ExpansionTile( + initiallyExpanded: initiallyExpanded, + childrenPadding: EdgeInsets.zero, + tilePadding: const EdgeInsets.symmetric(horizontal: 8), + title: SelectedAccountItem( + title: title, + cryptoAccountData: accounts[selectedAccountIndex], + isBoxOpen: true, + onPressed: isEnabled ? null : null, ), - child: ExpansionTile( - initiallyExpanded: initiallyExpanded, - childrenPadding: EdgeInsets.zero, - tilePadding: const EdgeInsets.symmetric(horizontal: 8), - title: SelectedAccountItem( - title: title, - cryptoAccountData: accounts[selectedAccountIndex], - isBoxOpen: true, - onPressed: isEnabled ? null : null, - ), - children: [ - ListView.separated( - itemCount: accounts.length, - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemBuilder: (context, i) { - return SelectBoxAccountItem( - cryptoAccountData: accounts[i], - isSelected: selectedAccountIndex == i, - listIndex: i, - onPressed: () { - onSelectAccount.call(accounts[i], i); - }, - ); - }, - separatorBuilder: (_, __) => Padding( - padding: const EdgeInsets.symmetric( - horizontal: Sizes.spaceSmall, - ), - child: Divider( - height: 0.2, - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.12), - ), + children: [ + ListView.separated( + itemCount: accounts.length, + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemBuilder: (context, i) { + return SelectBoxAccountItem( + cryptoAccountData: accounts[i], + isSelected: selectedAccountIndex == i, + listIndex: i, + onPressed: () { + onSelectAccount.call(accounts[i], i); + }, + ); + }, + separatorBuilder: (_, __) => Padding( + padding: const EdgeInsets.symmetric( + horizontal: Sizes.spaceSmall, + ), + child: Divider( + height: 0.2, + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.12), ), ), - const SizedBox(height: 10), - ], - ), + ), + const SizedBox(height: 10), + ], ), ], ), diff --git a/lib/dashboard/home/tab_bar/tokens/widgets/withdrawal_address_input.dart b/lib/dashboard/home/tab_bar/tokens/widgets/withdrawal_address_input.dart index ce0bfee14..b268a00cc 100644 --- a/lib/dashboard/home/tab_bar/tokens/widgets/withdrawal_address_input.dart +++ b/lib/dashboard/home/tab_bar/tokens/widgets/withdrawal_address_input.dart @@ -84,11 +84,14 @@ class _WithdrawalAddressInputPageState mainAxisSize: MainAxisSize.min, children: [ if (widget.caption != null) - Text( - widget.caption!, - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Theme.of(context).colorScheme.onSurface, - ), + Padding( + padding: const EdgeInsets.all(8), + child: Text( + widget.caption!, + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context).colorScheme.onSurface, + ), + ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -98,36 +101,39 @@ class _WithdrawalAddressInputPageState child: Form( autovalidateMode: autoValidateMode, key: formKey, - child: TextFormField( - controller: withdrawalAddressController, - style: Theme.of(context).textTheme.labelMedium, - textInputAction: TextInputAction.done, - maxLines: 2, - onChanged: (value) { - if (autoValidateMode == AutovalidateMode.disabled) { - formKey.currentState?.setState(() { - autoValidateMode = AutovalidateMode.always; - }); - } - }, - validator: (value) { - if (validateWalletAddress(value)) { - formKey.currentState?.setState(() { - autoValidateMode = AutovalidateMode.disabled; - }); - formKey.currentState?.save(); - return null; - } else { - return l10n.notAValidWalletAddress; - } - }, - onSaved: (value) { - widget.onValidAddress?.call(value!); - }, - decoration: InputDecoration( - border: InputBorder.none, - hintText: l10n.withdrawalInputHint, - contentPadding: EdgeInsets.zero, + child: Padding( + padding: const EdgeInsets.all(8), + child: TextFormField( + controller: withdrawalAddressController, + style: Theme.of(context).textTheme.labelMedium, + textInputAction: TextInputAction.done, + maxLines: 2, + onChanged: (value) { + if (autoValidateMode == AutovalidateMode.disabled) { + formKey.currentState?.setState(() { + autoValidateMode = AutovalidateMode.always; + }); + } + }, + validator: (value) { + if (validateWalletAddress(value)) { + formKey.currentState?.setState(() { + autoValidateMode = AutovalidateMode.disabled; + }); + formKey.currentState?.save(); + return null; + } else { + return l10n.notAValidWalletAddress; + } + }, + onSaved: (value) { + widget.onValidAddress?.call(value!); + }, + decoration: InputDecoration( + border: InputBorder.none, + hintText: l10n.withdrawalInputHint, + contentPadding: EdgeInsets.zero, + ), ), ), ), diff --git a/lib/dashboard/missing_creentials/view/missing_credentials_page.dart b/lib/dashboard/missing_creentials/view/missing_credentials_page.dart index 4057a334a..11f226f67 100644 --- a/lib/dashboard/missing_creentials/view/missing_credentials_page.dart +++ b/lib/dashboard/missing_creentials/view/missing_credentials_page.dart @@ -62,16 +62,6 @@ class MissingCredentialsView extends StatelessWidget { Widget build(BuildContext context) { final l10n = context.l10n; - String issuerName = ''; - - if (credentialManifest != null) { - issuerName = credentialManifest!.issuedBy?.name ?? ''; - } - - if (query != null) { - // TOOD(bibash): Is there issuer name? - issuerName = ''; - } return BlocBuilder( builder: (context, state) { @@ -84,7 +74,7 @@ class MissingCredentialsView extends StatelessWidget { body: Column( children: [ Text( - '''${l10n.youAreMissing} ${state.dummyCredentials.length} ${l10n.credentialsRequestedBy} $issuerName.''', + '''${l10n.youAreMissing} ${state.dummyCredentials.length} ${l10n.credentialsRequestedBy}''', style: Theme.of(context).textTheme.bodyMedium, textAlign: TextAlign.center, ), diff --git a/lib/dashboard/src/view/dashboard_page.dart b/lib/dashboard/src/view/dashboard_page.dart index 004440c08..908318036 100644 --- a/lib/dashboard/src/view/dashboard_page.dart +++ b/lib/dashboard/src/view/dashboard_page.dart @@ -237,7 +237,7 @@ class _DashboardViewState extends State { onTap: () => bottomTapped(1), isSelected: state.selectedIndex == 1, ), - const SizedBox(width: 75 * 0.6), + const SizedBox(width: 60), if (Parameters.walletHandlesCrypto) BottomBarItem( icon: IconStrings.cashInHand, diff --git a/lib/dashboard/src/widgets/bottom_bar_decoration.dart b/lib/dashboard/src/widgets/bottom_bar_decoration.dart index 3ba7a026a..2afdbd3cd 100644 --- a/lib/dashboard/src/widgets/bottom_bar_decoration.dart +++ b/lib/dashboard/src/widgets/bottom_bar_decoration.dart @@ -9,12 +9,11 @@ class BottomBarDecoration extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: Padding( - padding: const EdgeInsets.only(left: 11, right: 11, top: 8, bottom: 2), - child: BackgroundCard( - padding: const EdgeInsets.all(8), - child: child, - ), + child: BackgroundCard( + padding: const EdgeInsets.all(8), + borderRadius: 0, + height: 65, + child: child, ), ); } diff --git a/lib/dashboard/src/widgets/bottom_bar_item.dart b/lib/dashboard/src/widgets/bottom_bar_item.dart index 80b5ac21f..06d6803b3 100644 --- a/lib/dashboard/src/widgets/bottom_bar_item.dart +++ b/lib/dashboard/src/widgets/bottom_bar_item.dart @@ -60,17 +60,14 @@ class BottomBarItem extends StatelessWidget { } Color bottomBarItemColor(BuildContext context) { - final Color one = Theme.of(context).colorScheme.onPrimaryFixedVariant; - final Color two = Theme.of(context).colorScheme.primaryFixedDim; + final Color one = Theme.of(context).colorScheme.onSurface; + final Color two = Theme.of(context).colorScheme.onSurface; late Color selectedColor; - late Color unselectedColor; if (Theme.of(context).brightness == Brightness.light) { selectedColor = one; - unselectedColor = two; } else { selectedColor = two; - unselectedColor = one; } - return isSelected ? selectedColor : unselectedColor; + return isSelected ? selectedColor : Theme.of(context).colorScheme.outline; } } diff --git a/lib/import_wallet/view/import_from_wallet_page.dart b/lib/import_wallet/view/import_from_wallet_page.dart index 87f249705..9a6784e99 100644 --- a/lib/import_wallet/view/import_from_wallet_page.dart +++ b/lib/import_wallet/view/import_from_wallet_page.dart @@ -148,9 +148,8 @@ class _ImportFromOtherWalletViewState extends State { padding: const EdgeInsets.all(Sizes.spaceXSmall), width: Sizes.icon4x, height: Sizes.icon4x, - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.inversePrimary, - borderRadius: const BorderRadius.all( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all( Radius.circular(Sizes.smallRadius), ), ), diff --git a/lib/import_wallet/view/import_wallet_page.dart b/lib/import_wallet/view/import_wallet_page.dart index 93480fbee..e3b2da00d 100644 --- a/lib/import_wallet/view/import_wallet_page.dart +++ b/lib/import_wallet/view/import_wallet_page.dart @@ -195,12 +195,12 @@ class _ImportWalletViewState extends State { margin: const EdgeInsets.all(Sizes.spaceNormal), decoration: BoxDecoration( shape: BoxShape.circle, - color: Theme.of(context).colorScheme.onTertiary, + color: Theme.of(context).colorScheme.primary, ), - child: const Icon( + child: Icon( Icons.check, size: Sizes.icon, - color: Colors.white, + color: Theme.of(context).colorScheme.onSurface, ), ), ], diff --git a/lib/import_wallet/widgets/wallet_type_item.dart b/lib/import_wallet/widgets/wallet_type_item.dart index 312117bc7..272b55f89 100644 --- a/lib/import_wallet/widgets/wallet_type_item.dart +++ b/lib/import_wallet/widgets/wallet_type_item.dart @@ -31,9 +31,8 @@ class WalletTypeItem extends StatelessWidget { Container( alignment: Alignment.center, padding: const EdgeInsets.all(Sizes.spaceXSmall), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.inversePrimary, - borderRadius: const BorderRadius.all( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all( Radius.circular(Sizes.smallRadius), ), ), @@ -54,7 +53,7 @@ class WalletTypeItem extends StatelessWidget { Icon( Icons.keyboard_arrow_right_rounded, size: Sizes.icon, - color: Theme.of(context).colorScheme.inversePrimary, + color: Theme.of(context).colorScheme.onSurface, ), const SizedBox( width: Sizes.spaceSmall, diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index c329ee331..c86a28d76 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -757,9 +757,9 @@ "skip": "Skip", "userNotFitErrorMessage": "You are unable to get this card because some conditions are not fulfilled.", "youAreMissing": "You are missing", - "credentialsRequestedBy": "credentials requested by", + "credentialsRequestedBy": "credentials", "transactionIsLikelyToFail": "Transaction is likely to fail.", - "buy": "Buy", + "buy": "Buy coins", "thisFeatureIsNotSupportedYetForFantom": "This feature is not supported yet for Fantom.", "thisFeatureIsNotSupportedYetForBinance": "This feature is not supported yet for BNB Chain.", "faqs": "Frequently Asked Questions (FAQs)", diff --git a/lib/onboarding/gen_phrase/view/onboarding_gen_phrase.dart b/lib/onboarding/gen_phrase/view/onboarding_gen_phrase.dart index 34d1fe41c..001facc13 100644 --- a/lib/onboarding/gen_phrase/view/onboarding_gen_phrase.dart +++ b/lib/onboarding/gen_phrase/view/onboarding_gen_phrase.dart @@ -117,27 +117,11 @@ class _OnBoardingGenPhraseViewState extends State { const SizedBox(height: Sizes.spaceNormal), if (mnemonic != null) MnemonicDisplay(mnemonic: mnemonic!), - // const SizedBox( - // height: Sizes.spaceSmall, - // ), - // TextButton( - // onPressed: () { - // Clipboard.setData( - // ClipboardData( - // text: state.mnemonic.join(' '), - // ), - // ); - // }, - // child: Text( - // l10n.copyToClipboard, - // style: Theme.of(context).textTheme.bodyMedium!, - // ), - // ), const SizedBox(height: Sizes.spaceLarge), Text( l10n.onboardingAltmeMessage, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineSmall, + style: Theme.of(context).textTheme.titleMedium, ), ], ), diff --git a/lib/onboarding/starter/view/starter_page.dart b/lib/onboarding/starter/view/starter_page.dart index d9ae2f70d..dd45839a5 100644 --- a/lib/onboarding/starter/view/starter_page.dart +++ b/lib/onboarding/starter/view/starter_page.dart @@ -70,47 +70,47 @@ class StarterView extends StatelessWidget { const Spacer(flex: 1), SubTitle(profileModel: state.model), const Spacer(flex: 4), - MyElevatedButton( - text: l10n.createAccount, - verticalSpacing: 15, + MyOutlinedButton( + text: l10n.importAccount, onPressed: () async { await profileCubit.setWalletType( walletType: WalletType.personal, ); - await profileCubit.setProfileSetting( profileSetting: ProfileSetting.initial(), profileType: ProfileType.defaultOne, ); - await Navigator.of(context).push( ProtectWalletPage.route( - routeType: WalletRouteType.create, + routeType: WalletRouteType.import, ), ); }, ), - const Spacer(flex: 1), - MyOutlinedButton( - text: l10n.importAccount, + const SizedBox(height: 10), + MyElevatedButton( + text: l10n.createAccount, + verticalSpacing: 15, onPressed: () async { await profileCubit.setWalletType( walletType: WalletType.personal, ); + await profileCubit.setProfileSetting( profileSetting: ProfileSetting.initial(), profileType: ProfileType.defaultOne, ); + await Navigator.of(context).push( ProtectWalletPage.route( - routeType: WalletRouteType.import, + routeType: WalletRouteType.create, ), ); }, ), - const Spacer(flex: 1), + const SizedBox(height: 10), const AppVersionDrawer(isShortForm: true), - const Spacer(flex: 1), + const SizedBox(height: 10), ], ), ), diff --git a/lib/onboarding/wallet_ready/view/wallet_ready_page.dart b/lib/onboarding/wallet_ready/view/wallet_ready_page.dart index e1c654fde..476f3288b 100644 --- a/lib/onboarding/wallet_ready/view/wallet_ready_page.dart +++ b/lib/onboarding/wallet_ready/view/wallet_ready_page.dart @@ -98,7 +98,12 @@ class _WalletReadyViewState extends State { ), Text( l10n.walletReadyTitle, - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontWeight: FontWeight.bold, + ), ), const SizedBox( height: Sizes.spaceNormal, diff --git a/lib/onboarding/widgets/m_stepper.dart b/lib/onboarding/widgets/m_stepper.dart index 975eec0f3..173f3dedf 100644 --- a/lib/onboarding/widgets/m_stepper.dart +++ b/lib/onboarding/widgets/m_stepper.dart @@ -64,7 +64,9 @@ class Step extends StatelessWidget { width: width, margin: const EdgeInsets.all(4), decoration: BoxDecoration( - color: isEnable ? Colors.white : Colors.white.withOpacity(0.5), + color: isEnable + ? Theme.of(context).colorScheme.onSurface + : Theme.of(context).colorScheme.onSurface.withOpacity(0.5), borderRadius: const BorderRadius.all(Radius.circular(3)), ), ); diff --git a/lib/onboarding/widgets/protect_widget.dart b/lib/onboarding/widgets/protect_widget.dart index 4b18179ea..5cd9c0105 100644 --- a/lib/onboarding/widgets/protect_widget.dart +++ b/lib/onboarding/widgets/protect_widget.dart @@ -31,7 +31,7 @@ class ProtectWidget extends StatelessWidget { decoration: BoxDecoration( color: isSelected ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.secondaryContainer, + : Theme.of(context).colorScheme.surfaceContainer, borderRadius: const BorderRadius.all( Radius.circular( Sizes.normalRadius, diff --git a/lib/pin_code/view/confirm_pin_code_page.dart b/lib/pin_code/view/confirm_pin_code_page.dart index 3f89e92bc..6c49b16ce 100644 --- a/lib/pin_code/view/confirm_pin_code_page.dart +++ b/lib/pin_code/view/confirm_pin_code_page.dart @@ -90,7 +90,7 @@ class _ConfirmPinCodeViewState extends State { title: l10n.confirmYourPinCode, header: widget.isFromOnboarding ? MStepper( - step: 1, + step: 2, totalStep: byPassScreen ? 2 : 3, ) : null, diff --git a/lib/pin_code/view/pin_code_page.dart b/lib/pin_code/view/pin_code_page.dart index f49f5ddfe..a84f43f13 100644 --- a/lib/pin_code/view/pin_code_page.dart +++ b/lib/pin_code/view/pin_code_page.dart @@ -84,8 +84,8 @@ class _PinCodeViewState extends State { return PopScope( canPop: !widget.restrictToBack, child: BasePage( + padding: const EdgeInsets.symmetric(horizontal: Sizes.spaceSmall), backgroundColor: Theme.of(context).colorScheme.surface, - title: '', titleAlignment: Alignment.topCenter, titleLeading: widget.restrictToBack ? null : const BackLeadingButton(), scrollView: false, diff --git a/lib/pin_code/widgets/pin_code_widget.dart b/lib/pin_code/widgets/pin_code_widget.dart index 06da6a7cd..a4cce0e71 100644 --- a/lib/pin_code/widgets/pin_code_widget.dart +++ b/lib/pin_code/widgets/pin_code_widget.dart @@ -287,10 +287,10 @@ class PinCodeErrorMessage extends StatelessWidget { return BlocBuilder( builder: (context, state) { - Widget errorWidget = const SizedBox.shrink(); + Widget errorWidget = const PinCodeErrorText(''); switch (state.pinCodeError) { case PinCodeErrors.none: - errorWidget = const SizedBox.shrink(); + errorWidget = const PinCodeErrorText(''); case PinCodeErrors.errorSerie: errorWidget = PinCodeErrorText(l10n.pincodeSerie); case PinCodeErrors.errorSequence: diff --git a/lib/splash/widgets/subtitle_text.dart b/lib/splash/widgets/subtitle_text.dart index 6d2df07cc..c6a696fbf 100644 --- a/lib/splash/widgets/subtitle_text.dart +++ b/lib/splash/widgets/subtitle_text.dart @@ -23,7 +23,9 @@ class SubTitle extends StatelessWidget { child: Text( isEnterprise ? tag : l10n.splashSubtitle, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineSmall, + style: Theme.of(context).textTheme.headlineMedium!.copyWith( + fontWeight: FontWeight.normal, + ), ), ); } diff --git a/lib/theme/app_theme/app_theme.dart b/lib/theme/app_theme/app_theme.dart index 85c11007d..6de658ea6 100644 --- a/lib/theme/app_theme/app_theme.dart +++ b/lib/theme/app_theme/app_theme.dart @@ -25,9 +25,6 @@ class AppTheme { ), tabBarTheme: const TabBarTheme(dividerColor: Colors.transparent), textTheme: const TextTheme( - headlineSmall: TextStyle( - fontWeight: FontWeight.bold, - ), titleLarge: TextStyle( fontSize: 20, fontWeight: FontWeight.normal, diff --git a/test/app/shared/widget/custom_listtile_card_test.dart b/test/app/shared/widget/custom_listtile_card_test.dart index 11a91f2df..e6d3e9860 100644 --- a/test/app/shared/widget/custom_listtile_card_test.dart +++ b/test/app/shared/widget/custom_listtile_card_test.dart @@ -13,7 +13,6 @@ void main() { title: 'Test Title', subTitle: 'Test Subtitle', imageAssetPath: 'assets/launcher_icon.png', - recommended: true, onTap: () { triggerred = true; }, @@ -25,31 +24,8 @@ void main() { expect(find.text('Test Title'), findsOneWidget); expect(find.text('Test Subtitle'), findsOneWidget); expect(find.byType(Image), findsOneWidget); - expect(find.byType(Icon), findsOneWidget); - - expect(find.byIcon(Icons.thumb_up), findsOneWidget); await tester.tap(find.byType(ListTile)); expect(triggerred, isTrue); }); - - testWidgets( - 'CustomListTileCard does not display recommended icon when' - ' recommended is false', (WidgetTester tester) async { - await tester.pumpWidget( - MaterialApp( - home: Scaffold( - body: CustomListTileCard( - title: 'Test Title', - subTitle: 'Test Subtitle', - imageAssetPath: 'assets/launcher_icon.png', - recommended: false, - onTap: () {}, - ), - ), - ), - ); - - expect(find.byIcon(Icons.thumb_up), findsNothing); - }); } From 0efe445ce18536a60f00b29ad9567a26573a7046 Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Fri, 28 Jun 2024 10:18:46 +0000 Subject: [PATCH 5/6] chore --- .../view/congratulations_account_creation_page.dart | 2 +- .../manage_accounts/view/manage_accounts_page.dart | 2 +- .../drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart | 2 +- lib/pin_code/cubit/pin_code_view_cubit.dart | 4 ++-- lib/pin_code/widgets/pin_code_widget.dart | 1 - 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart b/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart index 27912563a..20a1bd42b 100644 --- a/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart +++ b/lib/dashboard/add_account/create_account/view/congratulations_account_creation_page.dart @@ -121,7 +121,7 @@ class _CongratulationsAccountCreationViewState ), Text(message, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headlineSmall), + style: Theme.of(context).textTheme.headlineSmall,), const SizedBox( height: Sizes.space3XLarge, ), diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart index 2b85a3bf0..9655ff717 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart @@ -114,7 +114,7 @@ class _ManageAccountsPageState extends State { physics: const NeverScrollableScrollPhysics(), itemBuilder: (context, i) { return Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(8), child: ManageAccountsItem( cryptoAccountData: state.cryptoAccount.data[i], listIndex: i, diff --git a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart index 6232a4434..9ce6a48c8 100644 --- a/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart +++ b/lib/dashboard/drawer/ssi/oidc4vc_settngs/widget/draft_type_widget.dart @@ -52,7 +52,7 @@ class DraftTypeWidget extends StatelessWidget { color: Theme.of(context).colorScheme.primary, ), ), - const DividerForRadioList() + const DividerForRadioList(), ], ); }, diff --git a/lib/pin_code/cubit/pin_code_view_cubit.dart b/lib/pin_code/cubit/pin_code_view_cubit.dart index f55ccf402..87d4e0c02 100644 --- a/lib/pin_code/cubit/pin_code_view_cubit.dart +++ b/lib/pin_code/cubit/pin_code_view_cubit.dart @@ -33,10 +33,10 @@ class PinCodeViewCubit extends Cubit { } void setEnteredPasscode( - String enteredPasscode, PinCodeErrors newPinCodeError) { + String enteredPasscode, PinCodeErrors newPinCodeError,) { emit( state.copyWith( - enteredPasscode: enteredPasscode, pinCodeError: newPinCodeError), + enteredPasscode: enteredPasscode, pinCodeError: newPinCodeError,), ); } diff --git a/lib/pin_code/widgets/pin_code_widget.dart b/lib/pin_code/widgets/pin_code_widget.dart index a4cce0e71..0f3d7a781 100644 --- a/lib/pin_code/widgets/pin_code_widget.dart +++ b/lib/pin_code/widgets/pin_code_widget.dart @@ -1,5 +1,4 @@ import 'package:altme/app/app.dart'; -import 'package:altme/dashboard/profile/cubit/profile_cubit.dart'; import 'package:altme/l10n/l10n.dart'; import 'package:altme/pin_code/pin_code.dart'; import 'package:flutter/material.dart'; From 6ad06420577ec82d333d8e8ae56e7bb847097654 Mon Sep 17 00:00:00 2001 From: hawkbee1 Date: Fri, 28 Jun 2024 10:28:02 +0000 Subject: [PATCH 6/6] version: 2.8.1+465 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0cb74abe2..e322d6ea4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: altme description: AltMe Flutter App -version: 2.8.0+464 +version: 2.8.1+465 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: sdk: ">=3.1.0 <4.0.0"