Skip to content
Snippets Groups Projects
Commit 926fab73 authored by vjrj's avatar vjrj
Browse files

wallet assistant (wip)

parent b474c2e4
No related branches found
No related tags found
No related merge requests found
...@@ -362,6 +362,20 @@ ...@@ -362,6 +362,20 @@
"distance_rule": "Distance Rule", "distance_rule": "Distance Rule",
"idty_waiting_confirmation": "waiting for confirmation", "idty_waiting_confirmation": "waiting for confirmation",
"idty_waiting_certifications": "waiting for certifications", "idty_waiting_certifications": "waiting for certifications",
"idty_waiting_distance_evaluation": "waiting for distance evaluation" "idty_waiting_distance_evaluation": "waiting for distance evaluation",
"wallet_options_title": "What do you want to do?",
"create_wallet_option": "Create a new wallet",
"create_wallet_description": "Set up a brand-new wallet for your Ğ1 transactions",
"import_wallet_option": "Import an existing wallet",
"import_wallet_description": "Load a wallet you already have, using different methods",
"create_wallet_title": "Choose how to create your Ğ1 wallet",
"create_no_password_option": "No passwords",
"create_no_password_description": "Ideal for small amounts and quick access",
"create_with_password_option": "With passwords",
"create_with_password_description": "Legacy duniter v1 type wallet",
"create_with_mnemonics_option": "With mnemonic phrase",
"create_with_mnemonics_description": "Recoverable wallet using a seed phrase (recommended in duniter v2)",
"clipboard_import_mnemonic": "Import mnemonic phrase",
"clipboard_import_mnemonic_description": "Enter a mnemonic phrase to recover your wallet"
} }
...@@ -368,5 +368,19 @@ ...@@ -368,5 +368,19 @@
"distance_rule": "Regla de la Distancia", "distance_rule": "Regla de la Distancia",
"idty_waiting_confirmation": "esperando confirmación", "idty_waiting_confirmation": "esperando confirmación",
"idty_waiting_certifications": "esperando certificaciones", "idty_waiting_certifications": "esperando certificaciones",
"idty_waiting_distance_evaluation": "esperando evaluación de distancia" "idty_waiting_distance_evaluation": "esperando evaluación de distancia",
"wallet_options_title": "¿Qué deseas hacer?",
"create_wallet_option": "Crear un monedero nuevo",
"create_wallet_description": "Configura un monedero nuevo para tus transacciones Ğ1",
"import_wallet_option": "Importar un monedero existente",
"import_wallet_description": "Carga un monedero que ya tienes utilizando diferentes métodos",
"create_wallet_title": "Elige cómo crear tu monedero Ğ1",
"create_no_password_option": "Sin contraseña",
"create_no_password_description": "Ideal para pequeñas cantidades y acceso rápido",
"create_with_password_option": "Con contraseñas",
"create_with_password_description": "Monedero clásico tipo duniter v1",
"create_with_mnemonics_option": "Con frase mnemónica",
"create_with_mnemonics_description": "Monedero recuperable utilizando una frase semilla (recomendado en Duniter v2)",
"clipboard_import_mnemonic": "Importar frase mnemónica",
"clipboard_import_mnemonic_description": "Introduce una frase mnemónica para recuperar tu monedero"
} }
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'fifth_screen/import_dialog.dart';
class WalletOptionsDialog extends StatelessWidget {
const WalletOptionsDialog({super.key});
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(tr('wallet_options_title')),
],
),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
ListTile(
leading: const Icon(Icons.add),
title: Text(tr('create_wallet_option')),
subtitle: Text(tr('create_wallet_description')),
onTap: () => _showCreateWalletOptions(context),
),
ListTile(
leading: const Icon(Icons.import_export),
title: Text(tr('import_wallet_option')),
subtitle: Text(tr('import_wallet_description')),
onTap: () => showSelectImportMethodDialog(context, 0)),
],
),
),
actions: <Widget>[
IconButton(
icon: const Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
],
);
}
void _showCreateWalletOptions(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(tr('create_wallet_title')),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
ListTile(
leading: const Icon(Symbols.money_bag),
title: Text(tr('create_no_password_option')),
subtitle: Text(tr('create_no_password_description')),
onTap: () => Navigator.of(context).pop('no_password'),
),
ListTile(
leading: const Icon(Icons.lock),
title: Text(tr('create_with_password_option')),
subtitle: Text(tr('create_with_password_description')),
onTap: () => Navigator.of(context).pop('with_password'),
),
ListTile(
leading: const Icon(Icons.password),
title: Text(tr('create_with_mnemonics_option')),
subtitle: Text(tr('create_with_mnemonics_description')),
onTap: () => Navigator.of(context).pop('with_mnemonics'),
),
],
),
),
actions: <Widget>[
IconButton(
icon: const Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
],
);
},
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment