diff --git a/assets/translations/en.json b/assets/translations/en.json index 0ffee34..a46a889 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -71,7 +71,8 @@ "areYouSureToDeleteWallet": "Are you sure you want to delete the chest \"{}\"?", "areYouSureForgetAllChests": "Are you sure you want to forget all your chests?", "areYouSureToForgetWallet": "Are you sure you wan to forget the wallet \"{}\"?", - "areYouSureYouWantToCertify": "Are you sure you want to certify the address:\n\n{}", + "areYouSureYouWantToCertify1": "Are you sure you want to certify the identity :", + "areYouSureYouWantToCertify2": "having the address :", "yes": "Yes", "no": "No", "keepYourMnemonicSecret": "Try to keep this phrase a secret, as it allows anyone who knows it to access all your wallets.", @@ -156,7 +157,7 @@ "hours": "{} hours {}", "days": "{} days", "months": "{} months", - "certify": "Certify", + "certify": "Certify this\nidentity", "from": "From:", "to": "To:", "amount": "Amount:", @@ -199,5 +200,6 @@ "thisMnemonicHasBeenCopiedToClipboard": "This mnemonic has been copied to clipboard", "smithCantMigrateIdentity":"You can't migrate this identity while you're member of smith web", "received": "Received", - "sent": "Sent" + "sent": "Sent", + "createIdentity": "Create a new \nidentity" } \ No newline at end of file diff --git a/assets/translations/es.json b/assets/translations/es.json index dc66365..b8a6a03 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -72,6 +72,8 @@ "areYouSureForgetAllChests": "¿Seguro de que quieres olvidar todos tus cofres?", "areYouSureToForgetWallet": "¿Seguro de que quieres olvidar el monedero \"{}\"?", "areYouSureYouWantToCertify": "¿Seguro de que quiere certificar a la dirección\n\n{}?", + "areYouSureYouWantToCertify1": "¿Seguro de que quiere certificar a la identidad :", + "areYouSureYouWantToCertify2": " a la dirección :", "yes": "Sí", "no": "No", "keepYourMnemonicSecret": "Intenta mantener esta frase de restauración en secreto, ya que permite a cualquiera que la conozca acceder a todas tus monederos.", @@ -156,7 +158,7 @@ "hours": "{} horas {}", "days": "{} dias", "months": "{} meses", - "certify": "Certificar", + "certify": "Certificar esta\nidentidad", "from": "De:", "to": "A:", "amount": "Importe:", @@ -199,5 +201,6 @@ "thisMnemonicHasBeenCopiedToClipboard": "This mnemonic has been copied to clipboard", "smithCantMigrateIdentity":"You can't migrate this identity while you're member of smith web", "received": "Received", - "sent": "Sent" + "sent": "Sent", + "createIdentity": "Create a new \nidentity" } diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 9b75ea3..d3510bf 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -71,7 +71,8 @@ "areYouSureToDeleteWallet": "Êtes-vous sûr de vouloir supprimer le coffre \"{}\" ?", "areYouSureForgetAllChests": "Êtes-vous sûr de vouloir oublier tous vos coffres ?", "areYouSureToForgetWallet": "Êtes-vous sûr de vouloir oublier le portefeuille \"{}\" ?", - "areYouSureYouWantToCertify": "Êtes-vous certain de vouloir certifier l'adresse:\n\n{}", + "areYouSureYouWantToCertify1": "Êtes-vous certain de vouloir certifier l'identité :", + "areYouSureYouWantToCertify2": "ayant pour adresse :", "yes": "Oui", "no": "Non", "keepYourMnemonicSecret": "Tâchez de garder cette phrase bien secrète, car elle permet à quiconque la connaît d’accéder à tous vos portefeuilles.", @@ -157,7 +158,7 @@ "hours": "{} heures {}", "days": "{} jours", "months": "{} mois", - "certify": "Certifier", + "certify": "Certifier cette\nidentité", "from": "Depuis:", "to": "Vers:", "amount": "Montant:", @@ -200,5 +201,6 @@ "thisMnemonicHasBeenCopiedToClipboard": "Cette phrase secrète viens d'être copié dans votre presse-papier.", "smithCantMigrateIdentity":"Vous ne pouvez pas migrer cette identité\ntant que vous êtes dans la toile forgerons", "received": "Reçus", - "sent": "Envoyés" + "sent": "Envoyés", + "createIdentity": "Créer sa nouvelle\nidentité" } diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index 9fadbb7..8b9de12 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -288,6 +288,9 @@ class SubstrateSdk with ChangeNotifier { result.putIfAbsent('certDelay', () => certDelayDuration); } else if (toStatus == 'Created') { result.putIfAbsent('toStatus', () => 1); + } else if (toStatus == 'noid') { + result.putIfAbsent('toStatus', () => 2); + result.putIfAbsent('canCert', () => 0); } else { result.putIfAbsent('canCert', () => 0); } diff --git a/lib/screens/activity.dart b/lib/screens/activity.dart index 1f98bc3..0fdedd0 100644 --- a/lib/screens/activity.dart +++ b/lib/screens/activity.dart @@ -57,7 +57,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier { final duniterIndexer = Provider.of(context, listen: false); if (indexerEndpoint == '') { - Column(children: [ + return Column(children: [ const SizedBox(height: 50), Text( "noNetworkNoHistory".tr(), diff --git a/lib/screens/certifications.dart b/lib/screens/certifications.dart index b38a5b4..67237e7 100644 --- a/lib/screens/certifications.dart +++ b/lib/screens/certifications.dart @@ -27,6 +27,8 @@ class CertificationsScreen extends StatelessWidget { )), body: SafeArea( child: Accordion( + paddingListTop: 10, + paddingListBottom: 10, maxOpenSections: 1, headerBackgroundColorOpened: orangeC, scaleWhenAnimating: true, diff --git a/lib/screens/common_elements.dart b/lib/screens/common_elements.dart index 89d8014..117d465 100644 --- a/lib/screens/common_elements.dart +++ b/lib/screens/common_elements.dart @@ -279,6 +279,92 @@ Future confirmPopup(BuildContext context, String title) async { ); } +Future confirmPopupCertification(BuildContext context, String question1, + String username, String question2, String address) async { + return showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return AlertDialog( + // actionsPadding: const EdgeInsets.all(0.0), + backgroundColor: backgroundColor, + content: SizedBox( + height: 240, + child: Column( + children: [ + const SizedBox(height: 15), + Text( + question1, + textAlign: TextAlign.center, + style: + const TextStyle(fontSize: 20, fontWeight: FontWeight.w400), + ), + const SizedBox(height: 20), + Text( + username, + textAlign: TextAlign.center, + style: + const TextStyle(fontSize: 24, fontWeight: FontWeight.w500), + ), + const SizedBox(height: 20), + Text( + question2, + textAlign: TextAlign.center, + style: + const TextStyle(fontSize: 20, fontWeight: FontWeight.w400), + ), + const SizedBox(height: 20), + Text( + address, + textAlign: TextAlign.center, + style: + const TextStyle(fontSize: 20, fontWeight: FontWeight.w500), + ), + const SizedBox(height: 20), + const Text( + '?', + textAlign: TextAlign.center, + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400), + ), + ], + ), + ), + actions: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + key: keyConfirm, + child: Text( + "yes".tr(), + style: const TextStyle( + fontSize: 25, + color: Color(0xffD80000), + ), + ), + onPressed: () { + Navigator.pop(context, true); + }, + ), + const SizedBox(width: 35), + TextButton( + child: Text( + "no".tr(), + style: const TextStyle(fontSize: 25), + ), + onPressed: () { + Navigator.pop(context, false); + }, + ), + const SizedBox(height: 120) + ], + ) + ], + ); + }, + ); +} + Future infoPopup(BuildContext context, String title) async { return showDialog( context: context, diff --git a/lib/screens/onBoarding/11_congratulations.dart b/lib/screens/onBoarding/11_congratulations.dart index 50411c3..110ceb8 100644 --- a/lib/screens/onBoarding/11_congratulations.dart +++ b/lib/screens/onBoarding/11_congratulations.dart @@ -58,24 +58,8 @@ Widget finishButton(BuildContext context) { backgroundColor: orangeC, // foreground ), onPressed: () { - //TODO: fix bad widget ancestor when pupUntil (multi_chest test failed) - - // Navigator.popUntil(homeContext, ModalRoute.withName('/')); - // Navigator.of(homeContext, rootNavigator: true) - // .popUntil(ModalRoute.withName('/')); - // while (Navigator.of(homeContext).canPop()) { - // Navigator.of(homeContext).pop(); - // } - - // Navigator.pushNamed(homeContext, '/mywallets'); - - // final tmpConext = homeContext; - // Navigator.pushNamedAndRemoveUntil( - // context, '/mywallets', (route) => route.isFirst); - // .then((value) => homeContext = tmpConext); - Navigator.pushNamedAndRemoveUntil( - homeContext, '/mywallets', ModalRoute.withName('/')); + context, '/mywallets', ModalRoute.withName('/')); }, child: Text("accessMyChest".tr(), style: diff --git a/lib/screens/wallet_view.dart b/lib/screens/wallet_view.dart index 3428281..02bb43a 100644 --- a/lib/screens/wallet_view.dart +++ b/lib/screens/wallet_view.dart @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; import 'package:gecko/models/g1_wallets_list.dart'; import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/providers/cesium_plus.dart'; +import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/home.dart'; import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/wallet_options.dart'; @@ -108,7 +109,7 @@ class WalletViewScreen extends StatelessWidget { body: SafeArea( child: Column(children: [ HeaderProfile(address: address, username: username), - SizedBox(height: isTall ? 10 : 0), + SizedBox(height: isTall ? 30 : 15), Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Column(children: [ SizedBox( @@ -148,6 +149,8 @@ class WalletViewScreen extends StatelessWidget { ]), Consumer(builder: (context, sub, _) { WalletData? defaultWallet = myWalletProvider.getDefaultWallet(); + final duniterIndexer = + Provider.of(context, listen: false); return FutureBuilder( future: sub.certState(defaultWallet.address!, address), builder: (context, AsyncSnapshot> snapshot) { @@ -211,12 +214,18 @@ class WalletViewScreen extends StatelessWidget { 'assets/gecko_certify.png')), ), onTap: () async { - final bool? result = await confirmPopup( - context, - "areYouSureYouWantToCertify".tr( - args: [ - getShortPubkey(address) - ])); + final bool? result = + await confirmPopupCertification( + context, + 'areYouSureYouWantToCertify1' + .tr(), + duniterIndexer + .walletNameIndexer[ + address] ?? + "noIdentity".tr(), + 'areYouSureYouWantToCertify2' + .tr(), + getShortPubkey(address)); if (result ?? false) { String? pin; @@ -260,7 +269,9 @@ class WalletViewScreen extends StatelessWidget { ), const SizedBox(height: 9), Text( - "certify".tr(), + toStatus == 0 + ? "certify".tr() + : "createIdentity".tr(), textAlign: TextAlign.center, style: TextStyle( fontSize: buttonFontSize, diff --git a/lib/widgets/header_profile.dart b/lib/widgets/header_profile.dart index 178dd1b..b2da0ef 100644 --- a/lib/widgets/header_profile.dart +++ b/lib/widgets/header_profile.dart @@ -123,14 +123,14 @@ class HeaderProfile extends StatelessWidget { // ), // ), // ), - const SizedBox(height: 55), + // const SizedBox(height: 55), ]), const Spacer(), Column(children: [ ClipOval( child: defaultAvatar(avatarSize), ), - const SizedBox(height: 25), + // const SizedBox(height: 25), ]), ]), ), diff --git a/pubspec.yaml b/pubspec.yaml index e59a0ca..99d6f98 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: Pay with G1. # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 0.0.13+41 +version: 0.0.13+42 environment: sdk: '>=2.12.0 <3.0.0'