improve UX identity confirmation action
This commit is contained in:
parent
5369599b20
commit
dd49e76fa1
|
@ -51,7 +51,6 @@
|
|||
"validate": "Validate",
|
||||
"confirm": "Confirm",
|
||||
"confirmPayment": "Confirm payment",
|
||||
"clickHereToConfirmIdentity": "Click here to confirm\nyour new identity",
|
||||
"geckoGenerateYourWalletFromMnemonic": "Ğecko builds your wallet from a **restoration sentence**. It is a bit like the blueprint that builds your wallet.",
|
||||
"keepThisMnemonicSecure": "Keep this sentence carefully, because without it Ğecko will not be able to rebuild your wallets the day you change your phone.",
|
||||
"geckoGeneratedYourMnemonicKeepItSecret": "Ğecko generated your mnemonic successfully! Keep it secret, because anyone who knows it can access all your wallets.",
|
||||
|
@ -188,5 +187,7 @@
|
|||
"migrateAccount": "Migrate account",
|
||||
"migrateIdentity": "Migrate identity",
|
||||
"identityMigration": "Identity migration",
|
||||
"areYouSureMigrateIdentity": "Are you sure you want to permanently migrate identity **{}** with balance of **{}** ?"
|
||||
"areYouSureMigrateIdentity": "Are you sure you want to permanently migrate identity **{}** with balance of **{}** ?",
|
||||
"someoneCreatedYourIdentity": "Someone created your {} identity !",
|
||||
"confirmMyIdentity": "Confirm my identity"
|
||||
}
|
|
@ -51,7 +51,6 @@
|
|||
"validate": "Validate",
|
||||
"confirm": "Confirm",
|
||||
"confirmPayment": "Confirm payment",
|
||||
"clickHereToConfirmIdentity": "Click here to confirm\nyour new identity",
|
||||
"geckoGenerateYourWalletFromMnemonic": "Ğecko builds your wallet from a **restoration sentence**. It is a bit like the blueprint that builds your wallet.",
|
||||
"keepThisMnemonicSecure": "Keep this sentence carefully, because without it Ğecko will not be able to rebuild your wallets the day you change your phone.",
|
||||
"geckoGeneratedYourMnemonicKeepItSecret": "Ğecko generated your mnemonic successfully! Keep it secret, because anyone who knows it can access all your wallets.",
|
||||
|
@ -188,5 +187,7 @@
|
|||
"migrateAccount": "Migrate account",
|
||||
"migrateIdentity": "Migrate identity",
|
||||
"identityMigration": "Identity migration",
|
||||
"areYouSureMigrateIdentity": "Are you sure you want to permanently migrate identity **{}** with balance of **{}** ?"
|
||||
"areYouSureMigrateIdentity": "Are you sure you want to permanently migrate identity **{}** with balance of **{}** ?",
|
||||
"someoneCreatedYourIdentity": "Someone created your {} identity !",
|
||||
"confirmMyIdentity": "Confirm my identity"
|
||||
}
|
|
@ -51,7 +51,6 @@
|
|||
"validate": "Valider",
|
||||
"confirm": "Confirmer",
|
||||
"confirmPayment": "Confirmer le paiement",
|
||||
"clickHereToConfirmIdentity": "Cliquez ici pour confirmer\nvotre nouvelle identité",
|
||||
"geckoGenerateYourWalletFromMnemonic": "Ğecko fabrique votre portefeuille à partir d’une **phrase de restauration**. Elle est un peu comme le plan qui permet de construire votre portefeuille.",
|
||||
"keepThisMnemonicSecure": "Conservez cette phrase précieusement, car sans elle Ğecko ne pourra pas reconstruire vos portefeuilles le jour où vous changez de téléphone.",
|
||||
"geckoGeneratedYourMnemonicKeepItSecret": "Gecko a généré votre phrase de restauration ! Tâchez de la garder bien secrète, car elle permet à quiconque la connaît d’accéder à tous vos portefeuilles.",
|
||||
|
@ -189,5 +188,7 @@
|
|||
"migrateAccount": "Migrer le compte",
|
||||
"migrateIdentity": "Migrer l'identité",
|
||||
"identityMigration": "Migration de l'identité",
|
||||
"areYouSureMigrateIdentity": "Êtes-vous certain de vouloir migrer définitivement l'identité **{}** et son solde de **{}** ?"
|
||||
"areYouSureMigrateIdentity": "Êtes-vous certain de vouloir migrer définitivement l'identité **{}** et son solde de **{}** ?",
|
||||
"someoneCreatedYourIdentity": "Quelqu'un a créé votre identité {} !",
|
||||
"confirmMyIdentity": "Confirmer mon identité"
|
||||
}
|
|
@ -31,7 +31,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
late bool isDefaultWallet;
|
||||
bool canValidateNameBool = false;
|
||||
Map<String, String> idtyStatusCache = {};
|
||||
|
||||
Future<NewWallet>? get badWallet => null;
|
||||
|
||||
int getPinLenght(walletNbr) {
|
||||
|
@ -166,15 +165,7 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
}
|
||||
case 'Created':
|
||||
{
|
||||
return isOwner
|
||||
? InkWell(
|
||||
child: _showText(
|
||||
'clickHereToConfirmIdentity'.tr(), 18, true),
|
||||
onTap: () async {
|
||||
await validateIdentity(context);
|
||||
},
|
||||
)
|
||||
: _showText('identityCreated'.tr());
|
||||
return _showText('identityCreated'.tr());
|
||||
}
|
||||
case 'ConfirmedByOwner':
|
||||
{
|
||||
|
@ -245,10 +236,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
height: 100,
|
||||
child: Column(children: [
|
||||
const SizedBox(height: 20),
|
||||
const Text(
|
||||
'Nom:',
|
||||
style: TextStyle(fontSize: 19),
|
||||
),
|
||||
TextField(
|
||||
onChanged: (_) => notifyListeners(),
|
||||
textAlign: TextAlign.center,
|
||||
|
|
|
@ -181,6 +181,7 @@ class WalletOptions extends StatelessWidget {
|
|||
Consumer<WalletOptionsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return Column(children: [
|
||||
confirmIdentityButton(walletProvider),
|
||||
pubkeyWidget(walletProvider, ctx),
|
||||
SizedBox(height: 10 * ratio),
|
||||
activityWidget(
|
||||
|
@ -279,6 +280,57 @@ class WalletOptions extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
Widget confirmIdentityButton(WalletOptionsProvider walletProvider) {
|
||||
return Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return FutureBuilder(
|
||||
future: sub.idtyStatus(walletProvider.address.text),
|
||||
initialData: '',
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data == 'Created') {
|
||||
return Column(children: [
|
||||
SizedBox(
|
||||
width: 320,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 4,
|
||||
primary: orangeC, // background
|
||||
onPrimary: Colors.white, // foreground
|
||||
),
|
||||
onPressed: () {
|
||||
walletProvider.validateIdentity(context);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) {
|
||||
// return const SearchResultScreen();
|
||||
// }),
|
||||
// );
|
||||
},
|
||||
child: Text(
|
||||
'confirmMyIdentity'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 21, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 7),
|
||||
Text(
|
||||
"someoneCreatedYourIdentity".tr(args: [currencyName]),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey[600],
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
]);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Widget pubkeyWidget(WalletOptionsProvider walletProvider, BuildContext ctx) {
|
||||
final String shortPubkey = getShortPubkey(walletProvider.address.text);
|
||||
return GestureDetector(
|
||||
|
|
Loading…
Reference in New Issue