diff --git a/assets/translations/en.json b/assets/translations/en.json index 938cb79..8279bfb 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -212,5 +212,9 @@ "indexer": "Indexer", "anAutoNodeChoosed": "A secure and valid node will be automatically used from a random list.", "rootWallet": "Root Wallet", - "blockN": "block N°{}" + "blockN": "block N°{}", + "thisIsNotAGoodCode": "This is not a good code", + "youHaveToBeConnectedToValidateChest": "You have to be connected\nto validate your chest", + "thisIdentityAlreadyExist": "This identity already exists" + } \ No newline at end of file diff --git a/assets/translations/es.json b/assets/translations/es.json index 2cb824b..5279a92 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -213,5 +213,8 @@ "indexer": "Indexer", "anAutoNodeChoosed": "Se usará automáticamente un nodo seguro y valido desde una lista aleatoria.", "rootWallet": "Monedero raíz", - "blockN": "bloque N°{}" + "blockN": "bloque N°{}", + "thisIsNotAGoodCode": "Este codígo no es valido", + "youHaveToBeConnectedToValidateChest": "Tienes que tener conneción\npara validar tu cofre", + "thisIdentityAlreadyExist": "Esta identidad ya existe" } diff --git a/assets/translations/fr.json b/assets/translations/fr.json index a1700b8..026a382 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -212,5 +212,8 @@ "indexer": "Indexer", "anAutoNodeChoosed": "Un noeud sûr et valide sera choisi automatiquement parmis une liste aléatoire.", "rootWallet": "Portefeuille racine", - "blockN": "bloc N°{}" + "blockN": "bloc N°{}", + "thisIsNotAGoodCode": "Ce n'est pas le bon code", + "youHaveToBeConnectedToValidateChest": "Vous devez vous connecter à internet\npour valider votre coffre", + "thisIdentityAlreadyExist": "Cette identité existe déjà" } diff --git a/assets/translations/it.json b/assets/translations/it.json index 0d56e56..b2fa492 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -213,5 +213,8 @@ "indexer": "Indexer", "anAutoNodeChoosed": "Un nodo sicuro e valido sará automaticamente scelto da una lista casuale.", "rootWallet": "Portafoglio radice", - "blockN": "blocco N°{}" + "blockN": "blocco N°{}", + "thisIsNotAGoodCode": "Questo codice non é valido", + "youHaveToBeConnectedToValidateChest": "Vous devez vous connecter à internet\npour valider votre coffre", + "thisIdentityAlreadyExist": "Identitá giá esistente" } \ No newline at end of file diff --git a/integration_test/duniter/data/node.key b/integration_test/duniter/data/node.key new file mode 100644 index 0000000..aa131f7 --- /dev/null +++ b/integration_test/duniter/data/node.key @@ -0,0 +1 @@ +7bd0907a4984e1ab7899edce63b2e286e8f3daad5a8e2bff40cee61ca6b036cd \ No newline at end of file diff --git a/integration_test/utility/general_actions.dart b/integration_test/utility/general_actions.dart index 2bf06f5..d1f3cea 100644 --- a/integration_test/utility/general_actions.dart +++ b/integration_test/utility/general_actions.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -66,7 +67,7 @@ Future restoreChest() async { await enterText(keyPinForm, 'AAAAA', 0); // Check if string "Accéder à mon coffre" is present in screen - await waitFor('Accéder à mon coffre'); + await waitFor('accessMyChest'.tr()); // Go to wallets home await tapKey(keyGoWalletsHome, duration: 0); @@ -84,7 +85,7 @@ Future restoreChest() async { await tapKey(keyCopyAddress); // Check if string "Cette adresse a été copié" is present in screen - await waitFor('Cette adresse a été copié'); + await waitFor('thisAddressHasBeenCopiedToClipboard'.tr()); // Pop screen 2 time to go back home await goBack(); @@ -126,7 +127,7 @@ Future onboardingNewChest() async { final askedWord = mnemonic[askedWordNumber - 1]; await enterText(keyInputWord, askedWord); - await waitFor('Continuer', exactMatch: true); + await waitFor('continue'.tr(), exactMatch: true); await tapKey(keyGoNext); await tapKey(keyGoNext); await tapKey(keyGoNext); @@ -143,13 +144,13 @@ Future onboardingNewChest() async { await enterText(keyPinForm, 'AAAAA', 0); // Check if string "Accéder à mon coffre" is present in screen - await waitFor('Accéder à mon coffre'); + await waitFor('accessMyChest'.tr()); // Go to wallets home await tapKey(keyGoWalletsHome, duration: 0); // Check if string "Mon portefeuille co" is present in screen - await waitFor('Mon portefeuille co'); + await waitFor('currentWallet'.tr()); await waitFor('0.0', exactMatch: true); // await waitFor('Scanner un'); } diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart index aa68aee..b672ef6 100644 --- a/lib/providers/wallet_options.dart +++ b/lib/providers/wallet_options.dart @@ -178,7 +178,7 @@ class WalletOptionsProvider with ChangeNotifier { ), const SizedBox(height: 10), Consumer(builder: (context, wOptions, _) { - return Text(idtyExist ? 'Cette identité existe déjà' : '', + return Text(idtyExist ? "thisIdentityAlreadyExist".tr() : '', style: TextStyle(color: Colors.red[500])); }) ]), diff --git a/lib/providers/wallets_profiles.dart b/lib/providers/wallets_profiles.dart index 5782ab2..2b7ecf0 100644 --- a/lib/providers/wallets_profiles.dart +++ b/lib/providers/wallets_profiles.dart @@ -30,7 +30,7 @@ class WalletsProfilesProvider with ChangeNotifier { try { barcode = await BarcodeScanner.scan(); } catch (e) { - log.e(e); + log.e("BarcodeScanner ERR: $e"); return 'false'; } if (isAddress(barcode.rawContent)) { diff --git a/lib/screens/myWallets/unlocking_wallet.dart b/lib/screens/myWallets/unlocking_wallet.dart index 18ddf30..8436368 100644 --- a/lib/screens/myWallets/unlocking_wallet.dart +++ b/lib/screens/myWallets/unlocking_wallet.dart @@ -117,7 +117,7 @@ class UnlockingWallet extends StatelessWidget { if (!myWalletProvider.isPinValid && !myWalletProvider.isPinLoading) Text( - "Ce n'est pas le bon code".tr(), + "thisIsNotAGoodCode".tr(), style: const TextStyle( color: Colors.red, fontWeight: FontWeight.w500), ), diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart index 337132a..92eff67 100644 --- a/lib/screens/onBoarding/10.dart +++ b/lib/screens/onBoarding/10.dart @@ -105,7 +105,7 @@ class OnboardingStepTen extends StatelessWidget { visible: !myWalletProvider.isPinValid && !myWalletProvider.isPinLoading, child: Text( - "Ce n'est pas le bon code".tr(), + "thisIsNotAGoodCode".tr(), style: const TextStyle( color: Colors.red, fontWeight: FontWeight.w500), ), @@ -117,10 +117,10 @@ class OnboardingStepTen extends StatelessWidget { ? pinForm(context, walletOptions, pinLenght, 1, 2) : Row( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ Text( - 'Vous devez vous connecter à internet\npour valider votre coffre', - style: TextStyle( + "youHaveToBeConnectedToValidateChest".tr(), + style: const TextStyle( fontSize: 20, color: Colors.redAccent, fontWeight: FontWeight.w500, diff --git a/lib/screens/transaction_in_progress.dart b/lib/screens/transaction_in_progress.dart index 77451f6..8e62974 100644 --- a/lib/screens/transaction_in_progress.dart +++ b/lib/screens/transaction_in_progress.dart @@ -42,6 +42,8 @@ class TransactionInProgress extends StatelessWidget { String actionName = ''; final bool isUdUnit = configBox.get('isUdUnit') ?? false; + log.d("$transType :: $actionName :: $result"); + switch (transType) { case 'pay': { @@ -94,7 +96,6 @@ class TransactionInProgress extends StatelessWidget { { isLoading = false; // jsonResult = json.decode(_result); - log.d(result); if (result.contains('blockHash: ')) { isValid = true; resultText = 'extrinsicValidated'.tr(args: [actionName]); @@ -110,7 +111,7 @@ class TransactionInProgress extends StatelessWidget { } else { exception = exceptionSplit[0]; } - // log.d('expection: $_exception'); + log.d('expection: $exceptionSplit'); switch (exception) { case 'cert.NotRespectCertPeriod': case 'identity.CreatorNotAllowedToCreateIdty': diff --git a/lib/styles.dart b/lib/styles.dart new file mode 100644 index 0000000..649b06c --- /dev/null +++ b/lib/styles.dart @@ -0,0 +1,40 @@ +// import 'dart:io'; +import 'package:flutter/material.dart'; +// import 'package:logger/logger.dart'; + +// --- THIS IS WIP --- + +class GeckoStyles { + TextStyle successBold(List pars) { + return TextStyle( + color: Colors.green.shade600, + fontWeight: FontWeight.bold, + ); + } + + TextStyle success() { + return TextStyle(color: Colors.green.shade600); + } + + TextStyle error500(List pars) { + return const TextStyle( + fontSize: 20, + color: Colors.redAccent, + fontWeight: FontWeight.w500, + ); + } + + TextStyle error() { + return const TextStyle(fontSize: 20, color: Colors.redAccent); + } + + TextStyle builder(Map pars) { + // pars["hola"] = 20; + // //int a = double.tryParse(source) pars["hola"]; + // return const TextStyle( fontSize: double.tryParse(pars["hola"]), + // color: Colors.redAccent, + // fontWeight: FontWeight.w500 + // ); + return const TextStyle(); + } +}