From f60cf11a022d4c8965474872a17fd683fcec69bb Mon Sep 17 00:00:00 2001 From: Roberto Chajin Ortiz Date: Sun, 23 Jul 2023 08:31:01 -0400 Subject: [PATCH 01/12] Translations to spanish added --- assets/translations/es.json | 228 ++++++++++++++++++++++++++++++++++++ ios/Runner/Info.plist | 1 + lib/main.dart | 1 + 3 files changed, 230 insertions(+) create mode 100644 assets/translations/es.json diff --git a/assets/translations/es.json b/assets/translations/es.json new file mode 100644 index 00000000..844b1f09 --- /dev/null +++ b/assets/translations/es.json @@ -0,0 +1,228 @@ +{ + "appTitle": "3DPass", + "@compare_page": {}, + "Rank": "Rango", + "Hash": "Hash", + "compare_page_appbar": "Comparar hashes principales", + "@global": {}, + "Share": "Compartir", + "Delete": "Eliminar", + "Remove": "Quitar", + "Save": "Guardar", + "Cancel": "Cancelar", + "Saved": "Guardado", + "Next": "Siguiente", + "Coming soon": "Próximamente", + "Reset": "Reiniciar", + "Copied": "Copiado", + "Apply": "Aplicar", + "Invalid": "Inválido", + "Clear": "Limpiar", + "Copy": "Copiar", + "OK": "Aceptar", + "@home_page": {}, + "calc_hashes_loader_text": "Calculando hashes...", + "snap_card_name": "Nombre: ", + "snap_card_stamp": "Sello: ", + "saved_objects_header": "Objetos guardados", + "object_title_prefix": "Objeto -", + "snapshots_subtitle": "instantáneas:", + "recognize_your_objects": "Reconoce tus objetos", + "open_web_wallet_button_label": "Abrir billetera web", + "get_from_file_button_label": "Obtener desde archivo", + "no_saved_objects_placeholder": "No hay objetos guardados disponibles", + "error_hash_list_bloc": "La lista de hashes no está inicializada :(", + "error_file_picker": "Error de seleccionar archivo", + "error_trans_bytes_unavaliable": "Error: tanto la entrada del usuario como el último bloque no están disponibles. Imposible escanear el objeto.", + "@preview_page": {}, + "MATCHES_number_plural": { + "zero": "No se encontraron coincidencias ", + "one": "{} coincidencia ", + "two": "{} coincidencias ", + "few": "{} coincidencias ", + "many": "{} coincidencias ", + "other": "{} coincidencias " + }, + "matches_FOUND": "encontradas", + "WHY_not_found": "¿Por qué?", + "save_this_object_button_label": "Guardar este objeto", + "save_this_snapshot_button_label": "Guardar esta instantánea", + "rename_this_snapshot_button_label": "Renombrar esta instantánea", + "top_10_hashes": "ID de Hash", + "get_new_object_appbar": "Obtener uno nuevo", + "show_and_share_dialog_button": "Mostrar y compartir", + "delete_snapshot_button": "Eliminar y borrar la caché", + "stable_hashes_list_title": "Hashes estables:", + "no_stable_hash_placeholder": "No se encontró ningún hash estable.", + "no_stable_hash_help": "Para obtener un hash estable, intenta escanear el objeto varias veces con la misma configuración de escaneo.", + "@rename_snap_dialog": {}, + "rename_snapshot_title": "Renombrar instantánea", + "rename_action": "Renombrar", + "@save_snap_dialog": {}, + "save_snapshot_title": "Guardar instantánea", + "@create_object_dialog": {}, + "create_object_title": "Crear nuevo objeto", + "create_object_input_label": "Nombre del objeto", + "create_object_input_hint": "Ingrese el nombre del objeto", + "create_object_snap_input_label": "Nombre de la instantánea", + "create_object_snap_input_hint": "Ingrese el nombre de la instantánea", + "create_action": "Crear", + "@settings_page": {}, + "settings_title": "Configuración", + "choose_algorithm_label": "Elegir algoritmo", + "algorithm_button_label": "Algoritmo de escaneo", + "grid_size_label": "Tamaño de la cuadrícula", + "n_sections_label": "Secciones N", + "n_sections_help": "Consejo. Usa 66-68 secciones para Grid2d y 15-16 para Grid2d_v2, Grid2d_v3.", + "trans_bytes_input_label": "Bytes de rotación", + "trans_bytes_empty_input": "Aleatorio", + "error_n_sections_validator": "Las secciones N deben ser un número", + "hash_settings_title": "Configuración de escaneo", + "lib_version_label": "Versión de la librería:", + "wallet_settings_title": "Configuración de la billetera", + "preview_settings_title": "Configuración de vista previa", + "app_settings_title": "Configuración de la aplicación", + "stable_requirement_label": "Hash estable", + "stable_requirement_button_text": "Requisito de hash estable", + "stable_requirement_help": "Cuántas veces debe repetirse un hash para considerarse estable", + "error_stable_is_invalid": "El requisito de hash estable debe ser un número entero positivo", + "preview_settings_pixel_ratio_label": "Relación de píxeles", + "wallet_settings_istestnet_switch": "Es red de prueba", + "node_url_label": "URL del nodo", + "error_hex": "Entrada no válida. Debe tener 8 dígitos", + "pixel_ratio_help_text": "Reducir el valor reduce la calidad de la vista previa, pero aumenta el rendimiento.", + "settings_text_span_title": "Propiedades de escaneo:", + "algorithm_span": "Algoritmo", + "grid_span": "Cuadrícula", + "n_sections_span": "nSecciones", + "lib_version_span": "Versión de la librería de hash", + "trans_bytes_span": "Bytes de rotación", + "node_url_button_label": "URL del nodo", + "node_url_subpage_label": "URL del nodo", + "antialias_button_label": "Antialias", + "dark_theme_switch_label": "Tema oscuro", + "show_zero_assets_label": "Mostrar activos con cantidad cero", + "set_pin_button_label": "Establecer código PIN", + "remove_pin_button_label": "Eliminar código PIN", + "@wallet_base": {}, + "wallet_header_title": "Billetera", + "create_account_button_label": "Nueva cuenta aleatoria", + "import_account_button_label": "Importar cuenta", + "init_status_sdk": "Inicializando...", + "init_status_connecting_to_node": "Conectando al nodo...", + "init_status_completed": "Conexión exitosa", + "init_status_connecting_to_node_failed": "Error al conectar al nodo", + "address_copied_to_clipboard": "Dirección copiada", + "choose_account_assets_page_drawer": "Elegir cuenta", + "@navigation": {}, + "bottom_label_scan": "Escanear", + "bottom_label_wallet": "Billetera", + "bottom_label_settings": "Configuración", + "@create_account_page": {}, + "create_account_title": "Generar cuenta", + "import_account_title": "Importar cuenta", + "create_warn1_header": "Ten en cuenta", + "create_warn1_text": "Nunca copiamos ni almacenamos tu mnemónico de cuenta fuera del almacenamiento de tu teléfono. Es tu responsabilidad mantenerlo seguro.", + "create_warn2_header": "Copia de seguridad del mnemónico", + "create_warn2_text": "Por favor, anota tu mnemónico y guárdalo en un lugar seguro.", + "create_warn2_text2": "El mnemónico se puede usar para restaurar tu billetera.", + "create_warn3_header": "No compartas tu mnemónico", + "create_warn3_text": "Guarda tu mnemónico cuidadosamente para no perder tus activos.", + "create_warn3_text2": "Cualquiera que tenga tu mnemónico tiene acceso completo a tu cuenta.", + "create_warn4_header": "No tomes capturas de pantalla", + "create_warn4_text": "No tomes capturas de pantalla, ya que pueden ser capturadas por malware de terceros, lo que resulta en la pérdida de activos.", + "create_warn5_header": "Ten cuidado", + "create_warn5_text": "Nunca compartas la configuración de escaneo del objeto elegido. Esto puede llevar a la pérdida de activos.", + "create_warn6_header": "Copia de seguridad de la semilla en bruto", + "create_warn6_text": "Por favor, anota la semilla en bruto elegida y guárdala en un lugar seguro.", + "create_warn6_text2": "Puede usarse para restaurar tu billetera.", + "backup_warn1_header": "Copia de seguridad del mnemónico", + "backup_warn1_text": "Por favor, anota tu mnemónico y guárdalo en un lugar seguro.", + "backup_confirm_header": "Confirmar el mnemónico", + "backup_confirm_text": "Por favor, haz clic en el mnemónico en el orden correcto para confirmar que la copia de seguridad es correcta.", + "create_credentials_name": "Nombre", + "create_credentials_name_error": "El nombre no puede estar vacío", + "create_credentials_password": "Contraseña", + "create_credentials_password_error": "6 a 18 dígitos y contiene números y letras", + "create_credentials_password2": "Confirmar Contraseña", + "create_credentials_password2_error": "Las contraseñas no coinciden", + "error_create_account": "Error. La cuenta NO fue creada.", + "create_account_loading": "Creando cuenta...", + "import_account_loading": "Importando cuenta...", + "error_import_duplicate": "Error: esta cuenta ya ha sido importada", + "error_import_invalid": "Error: esta cuenta no es válida", + "import_account_type_title": "Importar cuenta desde...", + "create_type_mnemonic": "Mnemónico", + "create_type_object": "Objeto 3D", + "create_account_from_object": "Crear cuenta desde Objeto 3D", + "create_from_object_text1": "Elegir objeto", + "create_from_object_text2": "Elegir hash estable", + "create_from_object_text2_hint": "Se usará como la semilla en bruto de tu cuenta.", + "create_from_object_error_no_stable_hashes": "ERROR. No se encontraron objetos con hashes estables.", + "import_type_mnemonic": "Mnemónico", + "import_mnemonic_hint": "Ingresar mnemónico", + "import_mnemonic_preview_placeholder": "Ingresar mnemónico para ver la dirección", + "invalid_input": "Entrada no válida", + "error_mnemonic_not_found": "Error: mnemónico no encontrado", + "error_empty_account_address": "La dirección no puede estar vacía", + "no_stable_hash_dialog_title": "Sin hash estable", + "no_stable_hash_dialog_text": "No puedes crear una cuenta desde un Objeto 3D porque no tienes un hash estable. Para crear uno, escanea el objeto varias veces o cambia el requisito de hash.", + "@assets_page": {}, + "balance_avaliable_title": "Disponible", + "balance_locked_title": "Bloqueado", + "balance_reserved_title": "Reservado", + "transfer_coins_button_label": "Transferir", + "recieve_coins_button_label": "Recibir", + "remove_account_button_label": "Eliminar cuenta", + "remove_accout_dialog_title": "Eliminar cuenta {}", + "remove_accout_dialog_text": "¿Estás seguro de que deseas eliminar esta cuenta?", + "assets_title": "Activos", + "@non_native_token": {}, + "non_native_token_token": "Activo {}", + "no_asset_history": "No se encontraron extrínsecos", + "mint_asset_history_label": "Crear {} {}", + "mint_asset_history_prefix": "Para:", + "set_metadata_asset_history_label": "Establecer metadatos para ID de activo: {}", + "set_metadata_asset_history_name": "Nombre: {}", + "set_metadata_asset_history_symbol": "Símbolo: {}", + "set_metadata_asset_history_decimals": "Decimales: {}", + "non_native_history_title_label": "Historial", + "create_token_widget": "Crear token", + "nnt_transfer_button_label": "Transferir activos", + "@recieve_page": {}, + "recieve_page_title": "Recibir", + "@transfer_page": {}, + "transfer_page_title": "Transferir", + "from_address_label": "Desde", + "to_address_label": "Dirección de destino", + "to_address_hint": "Ingresar dirección", + "amount_label": "Cantidad (Saldo: {})", + "amount_hint": "Ingresar cantidad", + "enter_password_hint": "contraseña", + "enter_password_label": "Tu contraseña", + "existential_deposit_label": "depósito existencial", + "existential_deposit_text": "La cantidad mínima que una cuenta debe tener para considerarse activa.", + "estimated_transfer_fee": "Tarifa estimada de transferencia", + "keep_alive_label": "mantener viva", + "keep_alive_text": "Con la opción mantener viva activada, la cuenta está protegida contra la eliminación debido a saldos bajos.", + "make_transfer_label": "Realizar transferencia", + "error_wrong_amount": "Se esperaba un número real más pequeño que el saldo disponible", + "could_not_check_address": "No se pudo verificar la dirección", + "wrong_address": "Dirección no válida proporcionada", + "transfer_loader_text": "Transfiriendo...", + "transfer_success_text": "Los fondos han sido enviados", + "error_empty": "No debe estar vacío", + "@transactions_history": {}, + "transactions_to": "Para", + "transactions_from": "De", + "transactions_title": "Historial de Transacciones", + "show_transfers": "Mostrar transferencias", + "no_transfers": "No se encontraron transferencias", + "first_page_error_title": "Algo salió mal", + "first_page_error_message": "La aplicación ha encontrado un error desconocido.\nPor favor, inténtalo de nuevo más tarde.", + "first_page_error_button": "Intentar de nuevo", + "@Screen_lock": {}, + "screen_lock_title": "Ingresar código PIN", + "screen_lock_title_set": "Establecer tu código PIN", + "screen_lock_title_confirm": "Confirmar tu código PIN" +} \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index edbb8f33..f95a01a6 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -17,6 +17,7 @@ CFBundleLocalizations en + es sr CFBundleName diff --git a/lib/main.dart b/lib/main.dart index 9dfffa3c..057dfd74 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,6 +25,7 @@ Future main() async { EasyLocalization( supportedLocales: const [ Locale('en'), + Locale('es'), Locale('sr'), ], path: 'assets/translations', From 2d925ddda9dbe4b605bb15282fa26533ed81f47b Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Sat, 5 Aug 2023 19:38:55 +0300 Subject: [PATCH 02/12] Global transfer dialog & perfect pixel ratio slider --- .../preview_settings/pixel_ratio_slider.dart | 2 +- .../domain/entities/transfer.dart | 18 ++++---- lib/main.dart | 42 ------------------- 3 files changed, 10 insertions(+), 52 deletions(-) diff --git a/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_slider.dart b/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_slider.dart index 8e02e9b1..8ded674d 100644 --- a/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_slider.dart +++ b/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_slider.dart @@ -15,7 +15,7 @@ class PixelRatioSlider extends StatelessWidget { valueNotifier: valueNotifier, minValue: minValue, maxValue: maxValue, - divisions: 5, + divisions: 6, label: 'preview_settings_pixel_ratio_label', helpText: 'pixel_ratio_help_text', ); diff --git a/lib/features/wallet_screen/domain/entities/transfer.dart b/lib/features/wallet_screen/domain/entities/transfer.dart index f30a382a..f5d1490b 100644 --- a/lib/features/wallet_screen/domain/entities/transfer.dart +++ b/lib/features/wallet_screen/domain/entities/transfer.dart @@ -8,8 +8,10 @@ import 'package:fluttertoast/fluttertoast.dart'; import 'package:polkawallet_sdk/api/types/txInfoData.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; import 'package:threedpass/core/widgets/default_loading_dialog.dart'; +import 'package:threedpass/features/home_page/bloc/home_context_cubit.dart'; import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart'; +// TODO Add transfer options: keep_alive or just transfer class Transfer { const Transfer({ required this.txInfo, @@ -58,9 +60,11 @@ class Transfer { return; } - final outerContext = BlocProvider.of(context).state; - // Very dangerous showDialog - DefaultLoadingDialog.show(outerContext, 'transfer_loader_text'.tr()); + // final outerContext = BlocProvider.of(context).state; + final globalContext = + BlocProvider.of(context).state.context; + + DefaultLoadingDialog.show(globalContext, 'transfer_loader_text'.tr()); try { final __ = await appService.plugin.sdk.api.tx.signAndSend( @@ -71,20 +75,16 @@ class Transfer { // There are two calls of this callback: p0 == 'Ready' and p0 == 'Broadcast' // print(p0 + ' ' + params.toString()); if (p0 == 'Ready') { - DefaultLoadingDialog.hide(outerContext); + DefaultLoadingDialog.hide(globalContext); context.router.pop(); Fluttertoast.showToast(msg: 'transfer_success_text'.tr()); } }, ); // final b = 1 + 1; - - // DefaultLoadingDialog.hide(outerContext); - // unawaited(context.router.pop()); - // unawaited(Fluttertoast.showToast(msg: 'transfer_success_text'.tr())); } on Object catch (e) { try { - DefaultLoadingDialog.hide(outerContext); + DefaultLoadingDialog.hide(globalContext); } on Object catch (e) { unawaited(Fluttertoast.showToast(msg: e.toString())); } diff --git a/lib/main.dart b/lib/main.dart index 057dfd74..67f01338 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,38 +35,6 @@ Future main() async { ); } -// class CustomError extends StatelessWidget { -// final FlutterErrorDetails errorDetails; - -// const CustomError({ -// Key? key, -// required this.errorDetails, -// }) : assert(errorDetails != null), -// super(key: key); - -// @override -// Widget build(BuildContext context) { -// return Card( -// child: Padding( -// child: Text( -// errorDetails.exception.toString() + -// '\n' + -// errorDetails.library.toString() + -// '\n' + -// errorDetails.stack.toString(), -// style: const TextStyle( -// color: Colors.white, -// fontWeight: FontWeight.bold, -// ), -// ), -// padding: const EdgeInsets.all(8.0), -// ), -// color: Colors.red, -// margin: EdgeInsets.zero, -// ); -// } -// } - class ThreeDApp extends StatelessWidget { ThreeDApp({final Key? key}) : super(key: key); @@ -86,16 +54,6 @@ class ThreeDApp extends StatelessWidget { child: PlatformApp.router( debugShowCheckedModeBanner: false, title: '3Dpass', - // builder: (BuildContext context, Widget? widget) { - // ErrorWidget.builder = (FlutterErrorDetails errorDetails) { - // return CustomError(errorDetails: errorDetails); - // }; - - // return widget ?? - // Material( - // child: Text('Error'), - // ); - // }, material: _MainMaterialAppRouterData(brightness).theme, cupertino: _MainCupertinoAppRouterData(brightness).theme, routerDelegate: _appRouter.delegate(), From 7dbd26276f36734effcfe3049b02d802d5f4784b Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Sun, 6 Aug 2023 17:04:15 +0300 Subject: [PATCH 03/12] FIX: Bug when balance was updated after polkawallet event --- lib/core/polkawallet/app_service.dart | 9 ++++++--- .../wallet_screen/domain/entities/transfer_meta_dto.dart | 2 +- .../presentation/assets_page/assets_page.dart | 2 +- .../presentation/assets_page/widgets/coins_balance.dart | 2 +- .../presentation/widgets/is_account_ready_builder.dart | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/core/polkawallet/app_service.dart b/lib/core/polkawallet/app_service.dart index d920e496..f70349ef 100644 --- a/lib/core/polkawallet/app_service.dart +++ b/lib/core/polkawallet/app_service.dart @@ -21,10 +21,10 @@ class AppService { required this.status, final NetworkStateData? networkStateData, }) : networkStateData = networkStateData ?? NetworkStateData(), - balance = ValueNotifier(BalanceData()), + chosenAccountBalance = ValueNotifier(BalanceData()), tokensAreLoading = ValueNotifier(false); - final ValueNotifier balance; + final ValueNotifier chosenAccountBalance; final ValueNotifier tokensAreLoading; // final ValueNotifier bestNumber = ValueNotifier(''); final Keyring keyring; @@ -56,7 +56,10 @@ class AppService { address, (final data) async { getIt().i('Balance updated: ${data.availableBalance}'); - balance.value = data; + + if (keyring.current.address == data.accountId) { + chosenAccountBalance.value = data; + } tokensAreLoading.value = true; await _setTokensData(address); diff --git a/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart b/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart index 67f1fc62..c62a8d80 100644 --- a/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart +++ b/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart @@ -32,7 +32,7 @@ class CoinsTransferMetaDTO extends TransferMetaDTO { @override String getBalance(final AppService appService) { return BalanceUtils.balance( - appService.balance.value.availableBalance as String?, + appService.chosenAccountBalance.value.availableBalance as String?, appService.networkStateData.safeDecimals, ); } diff --git a/lib/features/wallet_screen/presentation/assets_page/assets_page.dart b/lib/features/wallet_screen/presentation/assets_page/assets_page.dart index 84a41f0c..4f2ed0fe 100644 --- a/lib/features/wallet_screen/presentation/assets_page/assets_page.dart +++ b/lib/features/wallet_screen/presentation/assets_page/assets_page.dart @@ -34,7 +34,7 @@ class AssetsPage extends StatelessWidget { body: Column( crossAxisAlignment: CrossAxisAlignment.center, children: const [ - SizedBoxH36(), + SizedBoxH24(), CoinsBalance(), SizedBoxH16(), AssetPageButtonsPanel(), diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart index 02c79811..bba528f5 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart @@ -30,7 +30,7 @@ class CoinsBalance extends StatelessWidget { final int tokenDecimals = state.networkStateData.safeDecimals; return ValueListenableBuilder( - valueListenable: state.balance, + valueListenable: state.chosenAccountBalance, builder: (final context, final BalanceData balance, final child) { if (balance.isNull) { return placeHolder; diff --git a/lib/features/wallet_screen/presentation/widgets/is_account_ready_builder.dart b/lib/features/wallet_screen/presentation/widgets/is_account_ready_builder.dart index fc4b47a2..70294e1f 100644 --- a/lib/features/wallet_screen/presentation/widgets/is_account_ready_builder.dart +++ b/lib/features/wallet_screen/presentation/widgets/is_account_ready_builder.dart @@ -17,7 +17,7 @@ class IsAccountReadyBuilder extends StatelessWidget { Widget build(final BuildContext context) { return BlocBuilder( builder: (final context, final state) => ValueListenableBuilder( - valueListenable: state.balance, + valueListenable: state.chosenAccountBalance, builder: (final context, final BalanceData balance, final child) { return builder(context, !balance.isNull); }, From dc7d28d5b65fe4648f4876c9bb904ae7d26e1e80 Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Mon, 7 Aug 2023 18:09:01 +0300 Subject: [PATCH 04/12] FIX: Drawer is closed before push to account import --- lib/core/widgets/buttons/enum_button.dart | 46 +++++++++---------- .../create_account_wrapper.dart | 2 + .../widgets/calc_hash_loading_dialog.dart | 6 +-- .../hash_settings/hash_settings_title.dart | 5 +- .../widgets/hash_settings_block.dart | 1 - .../assets_page/widgets/accounts_drawer.dart | 1 - .../balance_card/main_balance_content.dart | 2 +- 7 files changed, 30 insertions(+), 33 deletions(-) diff --git a/lib/core/widgets/buttons/enum_button.dart b/lib/core/widgets/buttons/enum_button.dart index a98053a8..5f05176f 100644 --- a/lib/core/widgets/buttons/enum_button.dart +++ b/lib/core/widgets/buttons/enum_button.dart @@ -76,7 +76,7 @@ class _Icon extends StatelessWidget { const _Icon({required this.isEmpty}); @override - Widget build(BuildContext context) { + Widget build(final BuildContext context) { return Icon( Icons.chevron_right_outlined, color: isEmpty ? Colors.transparent : null, @@ -84,27 +84,27 @@ class _Icon extends StatelessWidget { } } -class _ListTileMaterial { - final ThemeData themeData; - final Color? backgroundColor; - final RoundedRectangleBorder border; +// class _ListTileMaterial { +// final ThemeData themeData; +// final Color? backgroundColor; +// final RoundedRectangleBorder border; - _ListTileMaterial({ - required this.themeData, - required this.backgroundColor, - required this.border, - }); +// _ListTileMaterial({ +// required this.themeData, +// required this.backgroundColor, +// required this.border, +// }); - MaterialTextButtonData style() { - return MaterialTextButtonData( - style: themeData.textButtonTheme.style!.copyWith( - // padding: MaterialStateProperty.all(EdgeInsets.zero), - backgroundColor: MaterialStateProperty.all( - backgroundColor ?? themeData.cardColor, - ), - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - shape: MaterialStateProperty.all(border), - ), - ); - } -} +// MaterialTextButtonData style() { +// return MaterialTextButtonData( +// style: themeData.textButtonTheme.style!.copyWith( +// // padding: MaterialStateProperty.all(EdgeInsets.zero), +// backgroundColor: MaterialStateProperty.all( +// backgroundColor ?? themeData.cardColor, +// ), +// tapTargetSize: MaterialTapTargetSize.shrinkWrap, +// shape: MaterialStateProperty.all(border), +// ), +// ); +// } +// } diff --git a/lib/features/accounts/presentation/pages/create_account/create_account_wrapper.dart b/lib/features/accounts/presentation/pages/create_account/create_account_wrapper.dart index c54e46c8..1d9975c1 100644 --- a/lib/features/accounts/presentation/pages/create_account/create_account_wrapper.dart +++ b/lib/features/accounts/presentation/pages/create_account/create_account_wrapper.dart @@ -16,12 +16,14 @@ class CreateAccountPageWrapper extends StatelessWidget }) : super(key: key); static void pushToGenerateRandom(final BuildContext context) { + Navigator.of(context).pop(); context.router.pushNamed( RoutePaths.createAccountMain + RoutePaths.createAccountRandomMnemonic, ); } static void pushToImportType(final BuildContext context) { + Navigator.of(context).pop(); context.router.pushNamed( RoutePaths.createAccountMain + RoutePaths.createAccountChooseType, ); diff --git a/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart b/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart index 3d4d2465..36af0c4b 100644 --- a/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart +++ b/lib/features/scan_page/presentation/widgets/calc_hash_loading_dialog.dart @@ -31,7 +31,7 @@ class CalcHashLoadingDialog extends StatelessWidget { height: indicatorSize, child: PlatformCircularProgressIndicator(), ), - SizedBox(width: 8), + const SizedBox(width: 8), Flexible( child: Container( width: double.infinity, @@ -43,8 +43,8 @@ class CalcHashLoadingDialog extends StatelessWidget { ), ), ), - SizedBox(width: 8), - SizedBox( + const SizedBox(width: 8), + const SizedBox( width: indicatorSize, ), ], diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/hash_settings_title.dart b/lib/features/settings_page/presentation/widgets/hash_settings/hash_settings_title.dart index 57946e2b..49b5b638 100644 --- a/lib/features/settings_page/presentation/widgets/hash_settings/hash_settings_title.dart +++ b/lib/features/settings_page/presentation/widgets/hash_settings/hash_settings_title.dart @@ -1,9 +1,6 @@ -// part of '../../settings_page.dart'; - import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:threedpass/core/theme/d3p_special_styles.dart'; import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart'; import 'package:threedpass/features/settings_page/presentation/widgets/settings_section_header.dart'; @@ -18,7 +15,7 @@ class ScanSettingsTitle extends StatelessWidget { .scanSettings .libVersion; - final textStyles = Theme.of(context).customTextStyles; + // final textStyles = Theme.of(context).customTextStyles; return SettingsSectionHeader( title: 'hash_settings_title', additionalText: ' | ' + 'lib_version_label'.tr() + ' ' + libVersion, diff --git a/lib/features/settings_page/presentation/widgets/hash_settings_block.dart b/lib/features/settings_page/presentation/widgets/hash_settings_block.dart index 3edf493c..cde8a953 100644 --- a/lib/features/settings_page/presentation/widgets/hash_settings_block.dart +++ b/lib/features/settings_page/presentation/widgets/hash_settings_block.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:threedpass/core/widgets/paddings.dart'; import 'package:threedpass/features/settings_page/presentation/widgets/hash_settings/algorithm_button.dart'; import 'package:threedpass/features/settings_page/presentation/widgets/hash_settings/grid_size_button.dart'; import 'package:threedpass/features/settings_page/presentation/widgets/hash_settings/hash_settings_title.dart'; diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart index 3b8c0aaa..6f2844d3 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart @@ -8,7 +8,6 @@ import 'package:threedpass/core/widgets/buttons/list_tile_button.dart'; import 'package:threedpass/core/widgets/buttons/text_button.dart'; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_wrapper.dart'; -// TODO Close drawer, when create new account and return to the route navigator class AccountsDrawer extends Drawer { AccountsDrawer({ required final List accounts, diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/main_balance_content.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/main_balance_content.dart index 792af94d..cb259a51 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/main_balance_content.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/main_balance_content.dart @@ -24,7 +24,7 @@ class _MainBalanceContent extends StatelessWidget { ), tokenSymbol: tokenSymbol, ), - const SizedBox(height: 16), + // const SizedBox(height: 16), AvaliableBalanceCard( balance: balance.availableBalance as String, tokenSymbol: tokenSymbol, From f5c71db46026161a0441dfc6925e2a59af6fa6e1 Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Tue, 8 Aug 2023 18:14:23 +0300 Subject: [PATCH 05/12] Update to Flutter 3.10.6 --- analysis_options.yaml | 8 +- android/build.gradle | 2 +- .../persistence/hive_universal_store.dart | 4 +- lib/core/polkawallet/network_params.dart | 4 +- lib/core/utils/hash2.dart | 3 +- lib/core/widgets/default_loading_dialog.dart | 2 +- .../presentation/pages/compare_page.dart | 4 +- .../presentation/widgets/compare_row.dart | 4 +- .../home_page/bloc/home_context_cubit.dart | 2 +- .../presentation/widgets/more_info.dart | 2 +- .../object_preview/init_render_extension.dart | 8 +- .../object_preview/init_scene_extension.dart | 2 +- .../object_preview/object_preview.dart | 2 +- .../widgets/preview_save_button.dart | 2 +- .../presentation/pages/scan_page.dart | 6 +- .../presentation/settings_page.dart | 4 +- .../widgets/app_settings/app_settings.dart | 12 +- .../widgets/hash_settings_block.dart | 4 +- .../widgets/preview_settings_block.dart | 4 +- .../widgets/wallet_settings_block.dart | 6 +- .../bloc/transfer_info_cubit.dart | 29 ++++ .../domain/entities/transfer.dart | 1 - .../domain/entities/transfer_meta_dto.dart | 1 + .../presentation/assets_page/assets_page.dart | 4 +- .../assets_page/widgets/account_actions.dart | 2 +- .../assets_page/widgets/accounts_drawer.dart | 3 - .../assets_page/widgets/buttons_panel.dart | 4 +- .../appservice_init_loader_page.dart | 4 +- .../no_accounts_page/no_accounts_page.dart | 4 +- .../widgets/account_card.dart | 6 +- .../widgets/asset_history_unknown_widget.dart | 2 +- .../recieve_page/widgets/qr_code.dart | 2 +- .../transfer_page/transfer_page.dart | 1 - .../widgets/make_transfer_button.dart | 21 +-- lib/main.dart | 2 - packages/calc/example/pubspec.lock | 42 ++--- packages/calc/example/pubspec.yaml | 4 +- packages/calc/example/test/widget_test.dart | 4 +- packages/calc/pubspec.lock | 34 ++-- packages/threedp_graphql/example/pubspec.lock | 34 ++-- pubspec.lock | 160 ++++++++++-------- pubspec.yaml | 38 ++--- test/test.dart | 4 +- 43 files changed, 257 insertions(+), 234 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 9d3e56ec..be17a0b6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -46,10 +46,10 @@ linter: analyzer: ### extra_pedantic ### - strong-mode: - # https://github.com/dart-lang/language/tree/master/resources/type-system - implicit-casts: false - implicit-dynamic: true + # strong-mode: + # # https://github.com/dart-lang/language/tree/master/resources/type-system + # implicit-casts: false + # implicit-dynamic: true language: # https://github.com/dart-lang/language/tree/master/resources/type-system strict-inference: true diff --git a/android/build.gradle b/android/build.gradle index 70b0c2b2..98367491 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -27,6 +27,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/lib/core/persistence/hive_universal_store.dart b/lib/core/persistence/hive_universal_store.dart index 144ac94d..3dfc6dd0 100644 --- a/lib/core/persistence/hive_universal_store.dart +++ b/lib/core/persistence/hive_universal_store.dart @@ -23,8 +23,8 @@ class HiveUniversalStore { /// Delete object by unknown key Future removeObject(final T value) async { final map = _box.toMap(); - final key = - map.keys.firstWhere((final k) => map[k] == value, orElse: () => null); + final dynamic key = map.keys + .firstWhere((final dynamic k) => map[k] == value, orElse: () => null); if (key != null) { await _box.delete(key); diff --git a/lib/core/polkawallet/network_params.dart b/lib/core/polkawallet/network_params.dart index 7e455a90..61718d58 100644 --- a/lib/core/polkawallet/network_params.dart +++ b/lib/core/polkawallet/network_params.dart @@ -3,7 +3,7 @@ import 'package:threedpass/core/polkawallet/constants.dart'; abstract class NetworkParamsFabric { static NetworkParams test(final String? nodeUrl) { - return NetworkParams.fromJson({ + return NetworkParams.fromJson({ 'name': d3pTestName, 'ss58': ss58formatTest, 'endpoint': nodeUrl ?? d3pDefaultNodeUrl, @@ -11,7 +11,7 @@ abstract class NetworkParamsFabric { } static NetworkParams live(final String? nodeUrl) { - return NetworkParams.fromJson({ + return NetworkParams.fromJson({ 'name': d3pLiveName, 'ss58': ss58formatLive, 'endpoint': nodeUrl ?? d3pDefaultNodeUrl, diff --git a/lib/core/utils/hash2.dart b/lib/core/utils/hash2.dart index 0ce3e44d..1c7d866c 100644 --- a/lib/core/utils/hash2.dart +++ b/lib/core/utils/hash2.dart @@ -2,7 +2,8 @@ // https://github.com/google/quiver-dart/blob/d5e5ddc5d4476cc35f3de9afc49925a7140b88a2/lib/src/core/hash.dart#L20 // ignore_for_file: parameter_assignments, prefer_final_parameters, type_annotate_public_apis, inference_failure_on_untyped_parameter -int hash2(a, b) => _finish(_combine(_combine(0, a.hashCode), b.hashCode)); +int hash2(dynamic a, dynamic b) => + _finish(_combine(_combine(0, a.hashCode), b.hashCode)); // Jenkins hash functions diff --git a/lib/core/widgets/default_loading_dialog.dart b/lib/core/widgets/default_loading_dialog.dart index a572e9be..9954f406 100644 --- a/lib/core/widgets/default_loading_dialog.dart +++ b/lib/core/widgets/default_loading_dialog.dart @@ -12,7 +12,7 @@ class DefaultLoadingDialog extends StatelessWidget { final String? text; static void show(final BuildContext context, [final String? text]) { - showPlatformDialog( + showPlatformDialog( useRootNavigator: false, context: context, barrierDismissible: false, diff --git a/lib/features/compare_page/presentation/pages/compare_page.dart b/lib/features/compare_page/presentation/pages/compare_page.dart index d237a324..b51187cd 100644 --- a/lib/features/compare_page/presentation/pages/compare_page.dart +++ b/lib/features/compare_page/presentation/pages/compare_page.dart @@ -19,10 +19,10 @@ class ComparePage extends StatelessWidget { @override Widget build(final BuildContext context) { - return D3pScaffold( + return const D3pScaffold( appbarTitle: 'compare_page_appbar', body: Column( - children: const [ + children: [ Flexible( child: Padding( padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), diff --git a/lib/features/compare_page/presentation/widgets/compare_row.dart b/lib/features/compare_page/presentation/widgets/compare_row.dart index bf2e2bd9..73c4b441 100644 --- a/lib/features/compare_page/presentation/widgets/compare_row.dart +++ b/lib/features/compare_page/presentation/widgets/compare_row.dart @@ -7,11 +7,11 @@ class CompareRow extends StatelessWidget { @override Widget build(final BuildContext context) { - return Row( + return const Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: const [ + children: [ Flexible( flex: 2, child: SizedBox( diff --git a/lib/features/home_page/bloc/home_context_cubit.dart b/lib/features/home_page/bloc/home_context_cubit.dart index 414c987b..dcf459bc 100644 --- a/lib/features/home_page/bloc/home_context_cubit.dart +++ b/lib/features/home_page/bloc/home_context_cubit.dart @@ -15,7 +15,7 @@ class HomeContextCubit extends Cubit { Future showDialogC( final Widget Function(BuildContext __) builder, ) async { - await showPlatformDialog( + await showPlatformDialog( useRootNavigator: false, context: state.context, barrierDismissible: false, diff --git a/lib/features/preview_page/presentation/widgets/more_info.dart b/lib/features/preview_page/presentation/widgets/more_info.dart index c585f573..9a94c985 100644 --- a/lib/features/preview_page/presentation/widgets/more_info.dart +++ b/lib/features/preview_page/presentation/widgets/more_info.dart @@ -49,7 +49,7 @@ class MoreInfo extends StatelessWidget { ), Container( alignment: Alignment.center, - child: QrImage( + child: QrImageView( padding: EdgeInsets.zero, data: state.snapshot.hashes.join('\n'), version: QrVersions.auto, diff --git a/lib/features/preview_page/presentation/widgets/object_preview/init_render_extension.dart b/lib/features/preview_page/presentation/widgets/object_preview/init_render_extension.dart index b066f827..735e4b3d 100644 --- a/lib/features/preview_page/presentation/widgets/object_preview/init_render_extension.dart +++ b/lib/features/preview_page/presentation/widgets/object_preview/init_render_extension.dart @@ -2,7 +2,7 @@ part of 'object_preview.dart'; extension __ on _State { void initRenderer() { - final Map _options = { + final Map _options = { 'width': width, 'height': height, 'gl': three3dRender.gl, @@ -16,7 +16,9 @@ extension __ on _State { renderer.setSize(width, height, false); renderer.shadowMap.enabled = false; - final pars = THREE.WebGLRenderTargetOptions({'format': THREE.RGBAFormat}); + final pars = THREE.WebGLRenderTargetOptions( + {'format': THREE.RGBAFormat}, + ); renderTarget = THREE.WebGLRenderTarget( (width * dpr).toInt(), (height * dpr).toInt(), @@ -46,7 +48,7 @@ extension __ on _State { final int _t = DateTime.now().millisecondsSinceEpoch; // This variable is unused, but NEVER DELETE IT!! - final _gl = three3dRender.gl; + final dynamic _gl = three3dRender.gl; controls.update(); diff --git a/lib/features/preview_page/presentation/widgets/object_preview/init_scene_extension.dart b/lib/features/preview_page/presentation/widgets/object_preview/init_scene_extension.dart index 4f76c833..61050f97 100644 --- a/lib/features/preview_page/presentation/widgets/object_preview/init_scene_extension.dart +++ b/lib/features/preview_page/presentation/widgets/object_preview/init_scene_extension.dart @@ -19,7 +19,7 @@ extension ___ on _State { void initControls() { // controls controls = THREE_JSM.ArcballControls(camera, _globalKey, scene, 1); - controls.addEventListener('change', (final event) { + controls.addEventListener('change', (final dynamic event) { render(); }); } diff --git a/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart b/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart index 695557ba..3870d792 100644 --- a/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart +++ b/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart @@ -111,7 +111,7 @@ class _State extends State { dpr = mqd.devicePixelRatio * previewSettings.pixelRatio; // init three3dRender - final Map _options = { + final Map _options = { 'antialias': previewSettings.antialias, 'alpha': false, 'width': width.toInt(), diff --git a/lib/features/preview_page/presentation/widgets/preview_save_button.dart b/lib/features/preview_page/presentation/widgets/preview_save_button.dart index 5ef55290..5b66197a 100644 --- a/lib/features/preview_page/presentation/widgets/preview_save_button.dart +++ b/lib/features/preview_page/presentation/widgets/preview_save_button.dart @@ -52,7 +52,7 @@ class PreviewSaveButton extends StatelessWidget { return D3pElevatedButton( minimumSize: const Size.fromHeight(46), text: title, - onPressed: () => routeToPush.show(context), + onPressed: () => routeToPush.show(context), ); } } diff --git a/lib/features/scan_page/presentation/pages/scan_page.dart b/lib/features/scan_page/presentation/pages/scan_page.dart index 191b637c..48ff0b83 100644 --- a/lib/features/scan_page/presentation/pages/scan_page.dart +++ b/lib/features/scan_page/presentation/pages/scan_page.dart @@ -10,13 +10,13 @@ class ScanPage extends StatelessWidget { @override Widget build(final BuildContext context) { - return D3pScaffold( + return const D3pScaffold( removeBackButton: true, appbarTitle: 'recognize_your_objects', body: Stack( children: [ - const ScanPageContent(), - const Align( + ScanPageContent(), + Align( alignment: Alignment.bottomRight, child: Padding( padding: EdgeInsets.all(16), diff --git a/lib/features/settings_page/presentation/settings_page.dart b/lib/features/settings_page/presentation/settings_page.dart index eb494955..24fdad65 100644 --- a/lib/features/settings_page/presentation/settings_page.dart +++ b/lib/features/settings_page/presentation/settings_page.dart @@ -19,10 +19,10 @@ class SettingsPage extends StatelessWidget { Widget build(final BuildContext context) { return PlatformScaffold( appBar: SettingsAppbar(), - body: SingleChildScrollView( + body: const SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, - children: const [ + children: [ SizedBoxH16(), HashSettingsBlock(), PreviewSettingsBlock(), diff --git a/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart b/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart index 65c1a6b8..9314d2df 100644 --- a/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart +++ b/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart @@ -10,17 +10,17 @@ class AppSettingsBlock extends StatelessWidget { @override Widget build(final BuildContext context) { - return Column( + return const Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SettingsSectionHeader( + SettingsSectionHeader( title: 'app_settings_title', ), // const _RequirementsTextField(), - const RequirementsButton(), - const DarkThemeSwitch(), - const ShowZeroAssets(), - const PinCodeSettings(), + RequirementsButton(), + DarkThemeSwitch(), + ShowZeroAssets(), + PinCodeSettings(), ], ); } diff --git a/lib/features/settings_page/presentation/widgets/hash_settings_block.dart b/lib/features/settings_page/presentation/widgets/hash_settings_block.dart index cde8a953..ca440e2d 100644 --- a/lib/features/settings_page/presentation/widgets/hash_settings_block.dart +++ b/lib/features/settings_page/presentation/widgets/hash_settings_block.dart @@ -10,9 +10,9 @@ class HashSettingsBlock extends StatelessWidget { @override Widget build(final BuildContext context) { - return Column( + return const Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ ScanSettingsTitle(), AlgorithmButton(), GridSizeButton(), diff --git a/lib/features/settings_page/presentation/widgets/preview_settings_block.dart b/lib/features/settings_page/presentation/widgets/preview_settings_block.dart index d49ae1b5..e8c81bb7 100644 --- a/lib/features/settings_page/presentation/widgets/preview_settings_block.dart +++ b/lib/features/settings_page/presentation/widgets/preview_settings_block.dart @@ -8,9 +8,9 @@ class PreviewSettingsBlock extends StatelessWidget { @override Widget build(final BuildContext context) { - return Column( + return const Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ SettingsSectionHeader( title: 'preview_settings_title', ), diff --git a/lib/features/settings_page/presentation/widgets/wallet_settings_block.dart b/lib/features/settings_page/presentation/widgets/wallet_settings_block.dart index 74892ecc..09f57474 100644 --- a/lib/features/settings_page/presentation/widgets/wallet_settings_block.dart +++ b/lib/features/settings_page/presentation/widgets/wallet_settings_block.dart @@ -7,14 +7,14 @@ class WalletSettingsBlock extends StatelessWidget { @override Widget build(final BuildContext context) { - return Column( + return const Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - const SettingsSectionHeader( + SettingsSectionHeader( title: 'wallet_settings_title', ), - const NodeUrlButton(), + NodeUrlButton(), ], ); } diff --git a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart index 6bbfb720..0adac0cd 100644 --- a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart +++ b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart @@ -1,6 +1,8 @@ +import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:polkawallet_sdk/api/types/txInfoData.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; +import 'package:threedpass/features/wallet_screen/domain/entities/transfer.dart'; import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart'; class TransferInfoCubit extends Cubit { @@ -37,6 +39,33 @@ class TransferInfoCubit extends Cubit { emit(TransferInfo(balance: state.balance, fees: fee)); } + + Future sendTransfer({ + required final AppService appService, + required final String amount, + required final String toAddress, + required final BuildContext context, + required final String password, + required final GlobalKey formKey, + }) async { + final txInfo = metaDTO.getTxInfo(appService); + final params = metaDTO.getParams( + appService, + amount, + toAddress, + ); + + await Transfer( + txInfo: txInfo, + params: params, + // amount: amountController.text, + appService: appService, + context: context, + toAddress: toAddress, + password: password, + formKey: formKey, + ).sendFunds(); + } } class TransferInfo { diff --git a/lib/features/wallet_screen/domain/entities/transfer.dart b/lib/features/wallet_screen/domain/entities/transfer.dart index f5d1490b..d688e798 100644 --- a/lib/features/wallet_screen/domain/entities/transfer.dart +++ b/lib/features/wallet_screen/domain/entities/transfer.dart @@ -60,7 +60,6 @@ class Transfer { return; } - // final outerContext = BlocProvider.of(context).state; final globalContext = BlocProvider.of(context).state.context; diff --git a/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart b/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart index c62a8d80..f2fe868e 100644 --- a/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart +++ b/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart @@ -12,6 +12,7 @@ abstract class TransferMetaDTO { String getBalance(final AppService appService); String getName(); TxInfoData getTxInfo(final AppService appService); + List getParams( final AppService appService, final String? amount, diff --git a/lib/features/wallet_screen/presentation/assets_page/assets_page.dart b/lib/features/wallet_screen/presentation/assets_page/assets_page.dart index 4f2ed0fe..58cf7952 100644 --- a/lib/features/wallet_screen/presentation/assets_page/assets_page.dart +++ b/lib/features/wallet_screen/presentation/assets_page/assets_page.dart @@ -31,9 +31,9 @@ class AssetsPage extends StatelessWidget { context: context, theme: theme, ), - body: Column( + body: const Column( crossAxisAlignment: CrossAxisAlignment.center, - children: const [ + children: [ SizedBoxH24(), CoinsBalance(), SizedBoxH16(), diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/account_actions.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/account_actions.dart index faa323af..f300bfd8 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/account_actions.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/account_actions.dart @@ -15,7 +15,7 @@ class AccountActions extends StatelessWidget { final outerContext = BlocProvider.of(context).state; switch (value) { case 1: - await showPlatformDialog( + await showPlatformDialog( context: outerContext, builder: (final _) => const RemoveAccountDialog(), ); diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart index 6f2844d3..ddd126c8 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart @@ -21,9 +21,6 @@ class AccountsDrawer extends Drawer { backgroundColor: Theme.of(context).customColors.scaffoldBackground, child: Column( crossAxisAlignment: CrossAxisAlignment.start, - // Important: Remove any padding from the ListView. - // padding: EdgeInsets.zero, - // physics: const NeverScrollableScrollPhysics(), children: [ PlatformAppBar( title: Text( diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart index e0dac696..cbab933b 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart @@ -7,9 +7,9 @@ class AssetPageButtonsPanel extends StatelessWidget { @override Widget build(final BuildContext context) { - return Row( + return const Row( mainAxisAlignment: MainAxisAlignment.spaceAround, - children: const [ + children: [ SizedBox(width: 16), Flexible( child: CoinTransferButton(), diff --git a/lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart b/lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart index 5a8026ea..7d7e29db 100644 --- a/lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart +++ b/lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart @@ -7,11 +7,11 @@ class AppServiceInitLoaderPage extends StatelessWidget { @override Widget build(final BuildContext context) { - return D3pScaffold( + return const D3pScaffold( removeBackButton: true, appbarTitle: 'wallet_header_title', body: Stack( - children: const [ + children: [ Align( alignment: Alignment.center, child: ConnectStatus(), diff --git a/lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart b/lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart index f1d97337..644de4d7 100644 --- a/lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart +++ b/lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart @@ -9,12 +9,12 @@ class NoAccountsPage extends StatelessWidget { @override Widget build(final BuildContext context) { - return D3pScaffold( + return const D3pScaffold( removeBackButton: true, appbarTitle: 'wallet_header_title', body: Column( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ ConnectStatus(), SizedBoxH24(), AccountCard(), diff --git a/lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart b/lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart index 180711b8..05a86f40 100644 --- a/lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart +++ b/lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart @@ -9,11 +9,11 @@ class AccountCard extends StatelessWidget { @override Widget build(final BuildContext context) { - return D3pCard( + return const D3pCard( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: Column( - children: const [ + children: [ SizedBoxH8(), CreateAccountButton(), SizedBoxH4(), diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart index 932abda3..2d731255 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart @@ -14,7 +14,7 @@ class AssetHistoryUnknownWidget extends StatelessWidget { return Column( children: [ Text(data.extrisincStatus.toString()), - Text('Unknown Event'), + const Text('Unknown Event'), Text(data.callModule), Text(data.arguments), BlockDateTimeW( diff --git a/lib/features/wallet_screen/presentation/recieve_page/widgets/qr_code.dart b/lib/features/wallet_screen/presentation/recieve_page/widgets/qr_code.dart index 964456f3..25578424 100644 --- a/lib/features/wallet_screen/presentation/recieve_page/widgets/qr_code.dart +++ b/lib/features/wallet_screen/presentation/recieve_page/widgets/qr_code.dart @@ -10,7 +10,7 @@ class _QRCode extends StatelessWidget { return Container( height: MediaQuery.of(context).size.width - 16 * 2, alignment: Alignment.center, - child: QrImage( + child: QrImageView( padding: EdgeInsets.zero, data: address, version: QrVersions.auto, diff --git a/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart b/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart index 30ea920d..c7dc4642 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart @@ -13,7 +13,6 @@ import 'package:threedpass/core/widgets/d3p_scaffold.dart'; import 'package:threedpass/core/widgets/input/textformfield/textformfield.dart'; import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart'; import 'package:threedpass/features/wallet_screen/bloc/transfer_info_cubit.dart'; -import 'package:threedpass/features/wallet_screen/domain/entities/transfer.dart'; part './widgets/make_transfer_button.dart'; part 'widgets/from_address_textfield.dart'; diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart index e28a7694..cfe17d4f 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart @@ -16,28 +16,17 @@ class _MakeTransferButton extends StatelessWidget { final GlobalKey formKey; final AppService appService; - // TODO Move from UI Future onPressed(final BuildContext context) async { - final transferInfoMeta = - BlocProvider.of(context).metaDTO; - // transferInfoMeta. - final txInfo = transferInfoMeta.getTxInfo(appService); - final params = transferInfoMeta.getParams( - appService, - amountController.text, - toAddressController.text, - ); + final transferInfoMeta = BlocProvider.of(context); - await Transfer( - txInfo: txInfo, - params: params, - // amount: amountController.text, + await transferInfoMeta.sendTransfer( appService: appService, - context: context, toAddress: toAddressController.text, + amount: amountController.text, password: passwordController.text, formKey: formKey, - ).sendFunds(); + context: context, + ); } @override diff --git a/lib/main.dart b/lib/main.dart index 67f01338..dced93b1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,14 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_phoenix/flutter_phoenix.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; -// import 'package:logger_flutter_plus/logger_flutter_plus.dart'; import 'package:threedpass/core/persistence/hive_setup.dart' as hive_setup; import 'package:threedpass/core/theme/d3p_special_colors.dart'; import 'package:threedpass/core/theme/d3p_theme.dart'; import 'package:threedpass/core/widgets/theme_builder.dart'; import 'package:threedpass/features/app/presentation/global_states_provider.dart'; import 'package:threedpass/router/router.dart'; -import 'package:threedpass/router/router.gr.dart'; import 'package:threedpass/setup.dart' as di_setup; Future main() async { diff --git a/packages/calc/example/pubspec.lock b/packages/calc/example/pubspec.lock index 4d67f04b..004fb699 100644 --- a/packages/calc/example/pubspec.lock +++ b/packages/calc/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -28,10 +28,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -44,10 +44,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" convert: dependency: transitive description: @@ -56,14 +56,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: a937da4c006989739ceb4d10e3bd6cce64ca85d0fe287fc5b2b9f6ee757dcee6 - url: "https://pub.dev" - source: hosted - version: "0.1.3" fake_async: dependency: transitive description: @@ -94,18 +86,18 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -118,18 +110,18 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -179,10 +171,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" typed_data: dependency: transitive description: @@ -200,4 +192,4 @@ packages: source: hosted version: "2.1.4" sdks: - dart: ">=2.18.0 <3.0.0" + dart: ">=3.0.0-0 <4.0.0" diff --git a/packages/calc/example/pubspec.yaml b/packages/calc/example/pubspec.yaml index adde9ca3..4186ef31 100644 --- a/packages/calc/example/pubspec.yaml +++ b/packages/calc/example/pubspec.yaml @@ -6,7 +6,7 @@ description: Demonstrates how to use the calc plugin. publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.17.5 <3.0.0" dependencies: flutter: @@ -22,7 +22,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.3 + # cupertino_icons: ^0.1.3 dev_dependencies: flutter_test: diff --git a/packages/calc/example/test/widget_test.dart b/packages/calc/example/test/widget_test.dart index eabc0e4c..390bf925 100644 --- a/packages/calc/example/test/widget_test.dart +++ b/packages/calc/example/test/widget_test.dart @@ -18,8 +18,8 @@ void main() { // Verify that platform version is retrieved. expect( find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data.startsWith('Running on:'), + (Widget widget) => + widget is Text && widget.data!.startsWith('Running on:'), ), findsOneWidget, ); diff --git a/packages/calc/pubspec.lock b/packages/calc/pubspec.lock index c096153a..dd217143 100644 --- a/packages/calc/pubspec.lock +++ b/packages/calc/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" cli_util: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" convert: dependency: "direct main" description: @@ -127,10 +127,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" lints: dependency: transitive description: @@ -151,10 +151,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -167,18 +167,18 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" quiver: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" typed_data: dependency: transitive description: @@ -265,4 +265,4 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.0 <4.0.0" + dart: ">=3.0.0-0 <4.0.0" diff --git a/packages/threedp_graphql/example/pubspec.lock b/packages/threedp_graphql/example/pubspec.lock index 46ec42ab..e9315468 100644 --- a/packages/threedp_graphql/example/pubspec.lock +++ b/packages/threedp_graphql/example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" crypto: dependency: transitive description: @@ -255,10 +255,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: transitive description: @@ -279,10 +279,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -295,10 +295,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" normalize: dependency: transitive description: @@ -311,10 +311,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_provider: dependency: transitive description: @@ -459,10 +459,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" threedp_graphql: dependency: "direct main" description: @@ -503,5 +503,5 @@ packages: source: hosted version: "0.2.0+3" sdks: - dart: ">=2.19.0 <4.0.0" + dart: ">=3.0.0-0 <4.0.0" flutter: ">=3.7.0" diff --git a/pubspec.lock b/pubspec.lock index 4b8d23d1..cfc83f65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" auto_route: dependency: "direct main" description: @@ -196,10 +196,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" charcode: dependency: transitive description: @@ -236,10 +236,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.1" convert: dependency: transitive description: @@ -252,18 +252,18 @@ packages: dependency: "direct main" description: name: copy_with_extension - sha256: "9c17d2b9a041ad19c97aa544c46a60f192cd409529bb9cfb98f48f336bb84d31" + sha256: "968ecc772545217d46ce3c8a7512fd71c2694c02d5a2d39c41a1965a1f52e55f" url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "5.0.3" copy_with_extension_gen: dependency: "direct dev" description: name: copy_with_extension_gen - sha256: "19ab5e5095a9047315b42a6c2bb7ddf59a85cd23a75278500661ced4299165e9" + sha256: c6c34e122ceab6e9560c626c60942dfaab2e39c0bc75d468b0360a8b2068f1b6 url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "5.0.3" cross_file: dependency: transitive description: @@ -332,10 +332,10 @@ packages: dependency: "direct main" description: name: easy_localization - sha256: "6a2e99fa0bfe5765bf4c6ca9b137d5de2c75593007178c5e4cd2ae985f870080" + sha256: "30ebf25448ffe169e0bd9bc4b5da94faa8398967a2ad2ca09f438be8b6953645" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" easy_logger: dependency: transitive description: @@ -452,10 +452,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: dd328189f2f4ccea042bb5b382d5e981691cc74b5a3429b9317bff2b19704489 + sha256: "21145c9c268d54b1f771d8380c195d2d6f655e0567dc1ca2f9c134c02c819e0a" url: "https://pub.dev" source: hosted - version: "5.2.8" + version: "5.3.3" fixnum: dependency: transitive description: @@ -481,10 +481,10 @@ packages: dependency: "direct main" description: name: flutter_bloc - sha256: "434951eea948dbe87f737b674281465f610b8259c16c097b8163ce138749a775" + sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.1.3" flutter_gl: dependency: "direct main" description: @@ -614,10 +614,10 @@ packages: dependency: "direct main" description: name: flutter_platform_widgets - sha256: "04a373ebf654162791bfce4b7c157f48ec35ea8b0abe2a68de837ceda8bd39ff" + sha256: "107d5bc9a167b4e268cba44075ee399b6b2c63d44ede28f7e8c983d7fa4b59be" url: "https://pub.dev" source: hosted - version: "2.2.6" + version: "3.3.5" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -638,10 +638,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "6ff9fa12892ae074092de2fa6a9938fb21dbabfdaa2ff57dc697ff912fc8d4b2" + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" url: "https://pub.dev" source: hosted - version: "1.1.6" + version: "2.0.7" flutter_test: dependency: "direct dev" description: flutter @@ -656,10 +656,10 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "2f9c4d3f4836421f7067a28f8939814597b27614e021da9d63e5d3fb6e212d25" + sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" url: "https://pub.dev" source: hosted - version: "8.2.1" + version: "8.2.2" freezed: dependency: "direct main" description: @@ -696,10 +696,10 @@ packages: dependency: "direct main" description: name: get_it - sha256: "290fde3a86072e4b37dbb03c07bec6126f0ecc28dad403c12ffe2e5a2d751ab7" + sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" url: "https://pub.dev" source: hosted - version: "7.2.0" + version: "7.6.0" get_storage: dependency: transitive description: @@ -848,10 +848,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.0" io: dependency: transitive description: @@ -864,10 +864,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: "direct main" description: @@ -936,10 +936,10 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.15" material_color_utilities: dependency: transitive description: @@ -952,10 +952,10 @@ packages: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -1008,10 +1008,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: cbff87676c352d97116af6dbea05aa28c4d65eb0f6d5677a520c11a69ca9a24d + sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.1.0" package_info_plus_platform_interface: dependency: transitive description: @@ -1024,18 +1024,10 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" - path_drawing: - dependency: transitive - description: - name: path_drawing - sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 - url: "https://pub.dev" - source: hosted - version: "1.0.1" + version: "1.8.3" path_parsing: dependency: transitive description: @@ -1048,50 +1040,50 @@ packages: dependency: "direct main" description: name: path_provider - sha256: c7edf82217d4b2952b2129a61d3ad60f1075b9299e629e149a8d2e39c2e6aad4 + sha256: "909b84830485dbcd0308edf6f7368bc8fd76afa26a270420f34cabea2a6467a0" url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.1.0" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "019f18c9c10ae370b08dce1f3e3b73bc9f58e7f087bb5e921f06529438ac0ae7" + sha256: "5d44fc3314d969b84816b569070d7ace0f1dea04bd94a83f74c4829615d22ad8" url: "https://pub.dev" source: hosted - version: "2.0.24" + version: "2.1.0" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: ad4c4d011830462633f03eb34445a45345673dfd4faf1ab0b4735fbd93b19183 + sha256: "1b744d3d774e5a879bb76d6cd1ecee2ba2c6960c03b1020cd35212f6aa267ac5" url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.3.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" + sha256: ba2b77f0c52a33db09fc8caf85b12df691bf28d983e84cf87ff6d693cfa007b3 url: "https://pub.dev" source: hosted - version: "2.1.10" + version: "2.2.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + sha256: bced5679c7df11190e1ddc35f3222c858f328fff85c3942e46e7f5589bf9eb84 url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.1.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: f53720498d5a543f9607db4b0e997c4b5438884de25b0f73098cc2671a51b130 + sha256: ee0e0d164516b90ae1f970bdf29f726f1aa730d7cfc449ecc74c495378b705da url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.2.0" pedantic: dependency: transitive description: @@ -1104,10 +1096,10 @@ packages: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.4.0" platform: dependency: transitive description: @@ -1193,18 +1185,18 @@ packages: dependency: transitive description: name: qr - sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" + sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.1" qr_flutter: dependency: "direct main" description: name: qr_flutter - sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e + sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.1.0" rational: dependency: transitive description: @@ -1437,10 +1429,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.5.1" three_dart: dependency: "direct main" description: @@ -1518,10 +1510,10 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e" + sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e" url: "https://pub.dev" source: hosted - version: "6.1.10" + version: "6.1.12" url_launcher_android: dependency: transitive description: @@ -1586,6 +1578,30 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.7" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" vector_math: dependency: transitive description: @@ -1662,10 +1678,10 @@ packages: dependency: transitive description: name: win32 - sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4 + sha256: "7dacfda1edcca378031db9905ad7d7bd56b29fd1a90b0908b71a52a12c41e36b" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "5.0.3" xdg_directories: dependency: transitive description: @@ -1678,10 +1694,10 @@ packages: dependency: transitive description: name: xml - sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.3.0" yaml: dependency: transitive description: @@ -1691,5 +1707,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.19.0 <4.0.0" - flutter: ">=3.7.0" + dart: ">=3.0.6 <3.0.7" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index c2fa708b..fa86cc1a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ publish_to: 'none' version: 2.7.1+27 environment: - sdk: ">=2.17.5 <3.0.0" + sdk: ">=3.0.6 <3.0.7" dependencies: flutter: @@ -25,7 +25,7 @@ dependencies: ## UI # three_dart: ^0.0.16 - three_dart: + three_dart: git: url: https://github.com/L3odr0id/three_dart.git ref: 695b58ab4ef889c4f472fb79420a36134974da5e # mobile-branch # branch name @@ -35,28 +35,28 @@ dependencies: url: https://github.com/L3odr0id/three_dart_jsm.git ref: b6c8e5fcf876151d601ab092fe7fc94901edb446 flutter_gl: ^0.0.18 - flutter_platform_widgets: ^2.0.0 + flutter_platform_widgets: ^3.3.5 flutter_screen_lock: ^9.0.1 - flutter_svg: ^1.1.1+1 - fluttertoast: ^8.0.9 + flutter_svg: ^2.0.7 + fluttertoast: ^8.2.2 infinite_scroll_pagination: ^3.2.0 unicons: ^2.1.0 - url_launcher: ^6.1.5 - file_picker: ^5.2.5 - qr_flutter: ^4.0.0 - package_info_plus: ^3.0.3 + url_launcher: ^6.1.12 + file_picker: ^5.3.3 + qr_flutter: ^4.1.0 + package_info_plus: ^4.1.0 ## Core auto_route: ^7.5.0 ffi: ^2.0.1 calc: path: packages/calc - get_it: ^7.2.0 - flutter_bloc: ^8.0.1 + get_it: ^7.6.0 + flutter_bloc: ^8.1.3 # flutter_form_bloc: ^0.30.1 # Use reactive forms instead - provider: ^6.0.3 - path_provider: ^2.0.13 + provider: ^6.0.5 + path_provider: ^2.1.0 hive: ^2.2.3 polkawallet_sdk: #0.5.1 git: @@ -64,14 +64,14 @@ dependencies: ref: 5492466fdcb65d2dcc62672cd4672824a47d609f # release/0.5.1 # branch name ## Code gen - copy_with_extension: ^4.0.2 - freezed: ^2.1.0+1 - equatable: ^2.0.3 + copy_with_extension: ^5.0.3 + freezed: ^2.3.5 + equatable: ^2.0.5 json_annotation: ^4.6.0 ## Utils - intl: ^0.17.0 - easy_localization: ^3.0.1 + intl: ^0.18.0 + easy_localization: ^3.0.2 share_plus: ^4.0.10 logger: ^1.1.0 flutter_keyboard_visibility: ^5.3.0 @@ -92,7 +92,7 @@ dev_dependencies: ## Generators hive_generator: ^2.0.0 - copy_with_extension_gen: ^4.0.1 + copy_with_extension_gen: ^5.0.3 build_runner: auto_route_generator: ^7.1.1 json_serializable: ^6.3.1 diff --git a/test/test.dart b/test/test.dart index 0d6999d4..c94c5cc5 100644 --- a/test/test.dart +++ b/test/test.dart @@ -12,10 +12,10 @@ void main() { testWidgets('MyWidget has a title and message', (tester) async { // Create the widget by telling the tester to build it. await tester.pumpWidget( - Directionality( + const Directionality( textDirection: TextDirection.ltr, child: Column( - children: const [ + children: [ LockedBalanceCard( tokenSymbol: 'P3D', tokenDecimals: 12, From c34bf0eaa1c96577dc2df9235a2c56eee5bfcc8a Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Wed, 9 Aug 2023 20:03:11 +0300 Subject: [PATCH 06/12] Add transferKeepAlive --- lib/core/polkawallet/app_service.g.dart | 46 +-- lib/core/polkawallet/utils/transfer_type.dart | 17 + lib/core/polkawallet/utils/tx_info.dart | 33 +- .../account_store_bloc.g.dart | 34 +- .../domain/account_advanced_options.g.dart | 4 +- .../accounts/domain/account_info.g.dart | 28 +- .../domain/entities/hash_object.g.dart | 4 +- .../domain/entities/snapshot.g.dart | 88 ++-- .../domain/entities/app_settings.g.dart | 36 +- .../domain/entities/global_settings.g.dart | 54 +-- .../domain/entities/preview_settings.g.dart | 24 +- .../domain/entities/scan_settings.g.dart | 44 +- .../domain/entities/wallet_settings.g.dart | 4 +- .../bloc/transfer_info_cubit.dart | 45 ++- .../bloc/transfer_info_cubit.g.dart | 78 ++++ .../domain/entities/transfer.dart | 2 - .../domain/entities/transfer_meta_dto.dart | 48 +-- .../assets_page/widgets/buttons_panel.dart | 2 +- ..._button.dart => coin_transfer_button.dart} | 1 + .../bloc/assets_get_extrisincs_cubit.dart | 2 +- .../entities/asset_history_create.g.dart | 54 +-- .../domain/entities/asset_history_mint.g.dart | 70 ++-- .../asset_history_set_meta_data.g.dart | 92 ++--- .../entities/asset_history_transfer.g.dart | 122 +++--- .../entities/asset_history_unknown.g.dart | 88 ++-- .../widgets/asset_transfer_button.dart | 3 + .../transfer_page/transfer_page.dart | 12 +- .../transfer_page/transfer_page_wrapper.dart | 5 +- .../widgets/amount_textfield.dart | 1 + .../widgets/make_transfer_button.dart | 1 - .../widgets/transfer_type_dropdown.dart | 48 +++ lib/router/router.gr.dart | 376 +++++++++--------- 32 files changed, 826 insertions(+), 640 deletions(-) create mode 100644 lib/core/polkawallet/utils/transfer_type.dart create mode 100644 lib/features/wallet_screen/bloc/transfer_info_cubit.g.dart rename lib/features/wallet_screen/presentation/assets_page/widgets/{transfer_button.dart => coin_transfer_button.dart} (97%) create mode 100644 lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart diff --git a/lib/core/polkawallet/app_service.g.dart b/lib/core/polkawallet/app_service.g.dart index a0a04c81..2ffc8bfc 100644 --- a/lib/core/polkawallet/app_service.g.dart +++ b/lib/core/polkawallet/app_service.g.dart @@ -7,14 +7,14 @@ part of 'app_service.dart'; // ************************************************************************** abstract class _$AppServiceCWProxy { - AppService keyring(Keyring keyring); - - AppService networkStateData(NetworkStateData? networkStateData); - AppService plugin(PolkawalletPlugin plugin); + AppService keyring(Keyring keyring); + AppService status(AppServiceInitStatus status); + AppService networkStateData(NetworkStateData? networkStateData); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AppService(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -22,32 +22,32 @@ abstract class _$AppServiceCWProxy { /// AppService(...).copyWith(id: 12, name: "My name") /// ```` AppService call({ - Keyring? keyring, - NetworkStateData? networkStateData, PolkawalletPlugin? plugin, + Keyring? keyring, AppServiceInitStatus? status, + NetworkStateData? networkStateData, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAppService.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAppService.copyWith.fieldName(...)` class _$AppServiceCWProxyImpl implements _$AppServiceCWProxy { - final AppService _value; - const _$AppServiceCWProxyImpl(this._value); - @override - AppService keyring(Keyring keyring) => this(keyring: keyring); + final AppService _value; @override - AppService networkStateData(NetworkStateData? networkStateData) => - this(networkStateData: networkStateData); + AppService plugin(PolkawalletPlugin plugin) => this(plugin: plugin); @override - AppService plugin(PolkawalletPlugin plugin) => this(plugin: plugin); + AppService keyring(Keyring keyring) => this(keyring: keyring); @override AppService status(AppServiceInitStatus status) => this(status: status); + @override + AppService networkStateData(NetworkStateData? networkStateData) => + this(networkStateData: networkStateData); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AppService(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -57,28 +57,28 @@ class _$AppServiceCWProxyImpl implements _$AppServiceCWProxy { /// AppService(...).copyWith(id: 12, name: "My name") /// ```` AppService call({ - Object? keyring = const $CopyWithPlaceholder(), - Object? networkStateData = const $CopyWithPlaceholder(), Object? plugin = const $CopyWithPlaceholder(), + Object? keyring = const $CopyWithPlaceholder(), Object? status = const $CopyWithPlaceholder(), + Object? networkStateData = const $CopyWithPlaceholder(), }) { return AppService( - keyring: keyring == const $CopyWithPlaceholder() || keyring == null - ? _value.keyring - // ignore: cast_nullable_to_non_nullable - : keyring as Keyring, - networkStateData: networkStateData == const $CopyWithPlaceholder() - ? _value.networkStateData - // ignore: cast_nullable_to_non_nullable - : networkStateData as NetworkStateData?, plugin: plugin == const $CopyWithPlaceholder() || plugin == null ? _value.plugin // ignore: cast_nullable_to_non_nullable : plugin as PolkawalletPlugin, + keyring: keyring == const $CopyWithPlaceholder() || keyring == null + ? _value.keyring + // ignore: cast_nullable_to_non_nullable + : keyring as Keyring, status: status == const $CopyWithPlaceholder() || status == null ? _value.status // ignore: cast_nullable_to_non_nullable : status as AppServiceInitStatus, + networkStateData: networkStateData == const $CopyWithPlaceholder() + ? _value.networkStateData + // ignore: cast_nullable_to_non_nullable + : networkStateData as NetworkStateData?, ); } } diff --git a/lib/core/polkawallet/utils/transfer_type.dart b/lib/core/polkawallet/utils/transfer_type.dart new file mode 100644 index 00000000..58cf8acc --- /dev/null +++ b/lib/core/polkawallet/utils/transfer_type.dart @@ -0,0 +1,17 @@ +class TransferTypeValue { + static const TransferType defaultType = TransferType.transferKeepAlive; + + const TransferTypeValue(this.type); + + final TransferType type; + + @override + String toString() { + return type.name; + } +} + +enum TransferType { + transfer, + transferKeepAlive, +} diff --git a/lib/core/polkawallet/utils/tx_info.dart b/lib/core/polkawallet/utils/tx_info.dart index 883657ad..6fa6f1f4 100644 --- a/lib/core/polkawallet/utils/tx_info.dart +++ b/lib/core/polkawallet/utils/tx_info.dart @@ -4,6 +4,7 @@ import 'package:polkawallet_sdk/plugin/store/balances.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; import 'package:threedpass/core/polkawallet/utils/balance_utils.dart'; import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart'; +import 'package:threedpass/core/polkawallet/utils/transfer_type.dart'; import 'package:threedpass/setup.dart'; abstract class TransferTxInfoI { @@ -13,7 +14,9 @@ abstract class TransferTxInfoI { required this.appService, }); - TxInfoData get txInfo; + TxInfoData txInfo( + final TransferType transferType, + ); List params(final String? amount, final String toAddress); } @@ -25,14 +28,20 @@ class AssetsTransferTx extends TransferTxInfoI { }); @override - TxInfoData get txInfo => TxInfoData( + TxInfoData txInfo( + final TransferType transferType, + ) => + TxInfoData( 'assets', - 'transfer', + TransferTypeValue(transferType).toString(), appService.userSenderData, ); @override - List params(final String? amount, final String toAddress) { + List params( + final String? amount, + final String toAddress, + ) { // https://polkadot.js.org/docs/substrate/extrinsics/#transferid-compactu32-target-multiaddress-amount-compactu128 if (tokenBalanceData.decimals == null) { @@ -61,12 +70,17 @@ class AssetsTransferTx extends TransferTxInfoI { } class CoinsTransferTx extends TransferTxInfoI { - const CoinsTransferTx({required super.appService}); + const CoinsTransferTx({ + required super.appService, + }); @override - TxInfoData get txInfo => TxInfoData( + TxInfoData txInfo( + final TransferType transferType, + ) => + TxInfoData( 'balances', - 'transfer', + TransferTypeValue(transferType).toString(), TxSenderData( appService.keyring.current.address, appService.keyring.current.pubKey, @@ -74,7 +88,10 @@ class CoinsTransferTx extends TransferTxInfoI { ); @override - List params(final String? amount, final String toAddress) { + List params( + final String? amount, + final String toAddress, + ) { final realAmount = BalanceUtils.tokenInt( amount, appService.networkStateData.safeDecimals, diff --git a/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.g.dart b/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.g.dart index f04b708a..4ec91f41 100644 --- a/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.g.dart +++ b/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.g.dart @@ -7,9 +7,6 @@ part of 'account_store_bloc.dart'; // ************************************************************************** abstract class _$AccountStoreStateCWProxy { - AccountStoreState accountAdvancedOptions( - AccountAdvancedOptions accountAdvancedOptions); - AccountStoreState addressIconsMap(Map addressIconsMap); AccountStoreState newAccount(AccountInfo newAccount); @@ -19,6 +16,9 @@ abstract class _$AccountStoreStateCWProxy { AccountStoreState recoveryInfo(RecoveryInfo recoveryInfo); + AccountStoreState accountAdvancedOptions( + AccountAdvancedOptions accountAdvancedOptions); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountStoreState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -26,24 +26,19 @@ abstract class _$AccountStoreStateCWProxy { /// AccountStoreState(...).copyWith(id: 12, name: "My name") /// ```` AccountStoreState call({ - AccountAdvancedOptions? accountAdvancedOptions, Map? addressIconsMap, AccountInfo? newAccount, Map>? pubKeyAddressMap, RecoveryInfo? recoveryInfo, + AccountAdvancedOptions? accountAdvancedOptions, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountStoreState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountStoreState.copyWith.fieldName(...)` class _$AccountStoreStateCWProxyImpl implements _$AccountStoreStateCWProxy { - final AccountStoreState _value; - const _$AccountStoreStateCWProxyImpl(this._value); - @override - AccountStoreState accountAdvancedOptions( - AccountAdvancedOptions accountAdvancedOptions) => - this(accountAdvancedOptions: accountAdvancedOptions); + final AccountStoreState _value; @override AccountStoreState addressIconsMap(Map addressIconsMap) => @@ -62,6 +57,11 @@ class _$AccountStoreStateCWProxyImpl implements _$AccountStoreStateCWProxy { AccountStoreState recoveryInfo(RecoveryInfo recoveryInfo) => this(recoveryInfo: recoveryInfo); + @override + AccountStoreState accountAdvancedOptions( + AccountAdvancedOptions accountAdvancedOptions) => + this(accountAdvancedOptions: accountAdvancedOptions); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountStoreState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -71,19 +71,13 @@ class _$AccountStoreStateCWProxyImpl implements _$AccountStoreStateCWProxy { /// AccountStoreState(...).copyWith(id: 12, name: "My name") /// ```` AccountStoreState call({ - Object? accountAdvancedOptions = const $CopyWithPlaceholder(), Object? addressIconsMap = const $CopyWithPlaceholder(), Object? newAccount = const $CopyWithPlaceholder(), Object? pubKeyAddressMap = const $CopyWithPlaceholder(), Object? recoveryInfo = const $CopyWithPlaceholder(), + Object? accountAdvancedOptions = const $CopyWithPlaceholder(), }) { return AccountStoreState( - accountAdvancedOptions: - accountAdvancedOptions == const $CopyWithPlaceholder() || - accountAdvancedOptions == null - ? _value.accountAdvancedOptions - // ignore: cast_nullable_to_non_nullable - : accountAdvancedOptions as AccountAdvancedOptions, addressIconsMap: addressIconsMap == const $CopyWithPlaceholder() || addressIconsMap == null ? _value.addressIconsMap @@ -104,6 +98,12 @@ class _$AccountStoreStateCWProxyImpl implements _$AccountStoreStateCWProxy { ? _value.recoveryInfo // ignore: cast_nullable_to_non_nullable : recoveryInfo as RecoveryInfo, + accountAdvancedOptions: + accountAdvancedOptions == const $CopyWithPlaceholder() || + accountAdvancedOptions == null + ? _value.accountAdvancedOptions + // ignore: cast_nullable_to_non_nullable + : accountAdvancedOptions as AccountAdvancedOptions, ); } } diff --git a/lib/features/accounts/domain/account_advanced_options.g.dart b/lib/features/accounts/domain/account_advanced_options.g.dart index 5bc5a076..36d9dd0c 100644 --- a/lib/features/accounts/domain/account_advanced_options.g.dart +++ b/lib/features/accounts/domain/account_advanced_options.g.dart @@ -26,10 +26,10 @@ abstract class _$AccountAdvancedOptionsCWProxy { /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountAdvancedOptions.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountAdvancedOptions.copyWith.fieldName(...)` class _$AccountAdvancedOptionsCWProxyImpl implements _$AccountAdvancedOptionsCWProxy { - final AccountAdvancedOptions _value; - const _$AccountAdvancedOptionsCWProxyImpl(this._value); + final AccountAdvancedOptions _value; + @override AccountAdvancedOptions path(String path) => this(path: path); diff --git a/lib/features/accounts/domain/account_info.g.dart b/lib/features/accounts/domain/account_info.g.dart index c950e5a0..e7069dcb 100644 --- a/lib/features/accounts/domain/account_info.g.dart +++ b/lib/features/accounts/domain/account_info.g.dart @@ -29,10 +29,10 @@ abstract class _$AccountCreateMnemonicCWProxy { /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountCreateMnemonic.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountCreateMnemonic.copyWith.fieldName(...)` class _$AccountCreateMnemonicCWProxyImpl implements _$AccountCreateMnemonicCWProxy { - final AccountCreateMnemonic _value; - const _$AccountCreateMnemonicCWProxyImpl(this._value); + final AccountCreateMnemonic _value; + @override AccountCreateMnemonic mnemonic(String mnemonic) => this(mnemonic: mnemonic); @@ -80,12 +80,12 @@ extension $AccountCreateMnemonicCopyWith on AccountCreateMnemonic { } abstract class _$AccountCreateSeedCWProxy { + AccountCreateSeed seed(String seed); + AccountCreateSeed name(String name); AccountCreateSeed password(String password); - AccountCreateSeed seed(String seed); - /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountCreateSeed(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -93,17 +93,20 @@ abstract class _$AccountCreateSeedCWProxy { /// AccountCreateSeed(...).copyWith(id: 12, name: "My name") /// ```` AccountCreateSeed call({ + String? seed, String? name, String? password, - String? seed, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountCreateSeed.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountCreateSeed.copyWith.fieldName(...)` class _$AccountCreateSeedCWProxyImpl implements _$AccountCreateSeedCWProxy { + const _$AccountCreateSeedCWProxyImpl(this._value); + final AccountCreateSeed _value; - const _$AccountCreateSeedCWProxyImpl(this._value); + @override + AccountCreateSeed seed(String seed) => this(seed: seed); @override AccountCreateSeed name(String name) => this(name: name); @@ -111,9 +114,6 @@ class _$AccountCreateSeedCWProxyImpl implements _$AccountCreateSeedCWProxy { @override AccountCreateSeed password(String password) => this(password: password); - @override - AccountCreateSeed seed(String seed) => this(seed: seed); - @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountCreateSeed(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -123,11 +123,15 @@ class _$AccountCreateSeedCWProxyImpl implements _$AccountCreateSeedCWProxy { /// AccountCreateSeed(...).copyWith(id: 12, name: "My name") /// ```` AccountCreateSeed call({ + Object? seed = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), Object? password = const $CopyWithPlaceholder(), - Object? seed = const $CopyWithPlaceholder(), }) { return AccountCreateSeed( + seed: seed == const $CopyWithPlaceholder() || seed == null + ? _value.seed + // ignore: cast_nullable_to_non_nullable + : seed as String, name: name == const $CopyWithPlaceholder() || name == null ? _value.name // ignore: cast_nullable_to_non_nullable @@ -136,10 +140,6 @@ class _$AccountCreateSeedCWProxyImpl implements _$AccountCreateSeedCWProxy { ? _value.password // ignore: cast_nullable_to_non_nullable : password as String, - seed: seed == const $CopyWithPlaceholder() || seed == null - ? _value.seed - // ignore: cast_nullable_to_non_nullable - : seed as String, ); } } diff --git a/lib/features/hashes_list/domain/entities/hash_object.g.dart b/lib/features/hashes_list/domain/entities/hash_object.g.dart index 4a0437c4..4eaa0864 100644 --- a/lib/features/hashes_list/domain/entities/hash_object.g.dart +++ b/lib/features/hashes_list/domain/entities/hash_object.g.dart @@ -25,10 +25,10 @@ abstract class _$HashObjectCWProxy { /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHashObject.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHashObject.copyWith.fieldName(...)` class _$HashObjectCWProxyImpl implements _$HashObjectCWProxy { - final HashObject _value; - const _$HashObjectCWProxyImpl(this._value); + final HashObject _value; + @override HashObject name(String name) => this(name: name); diff --git a/lib/features/hashes_list/domain/entities/snapshot.g.dart b/lib/features/hashes_list/domain/entities/snapshot.g.dart index 5f7f0dcf..884a1cd4 100644 --- a/lib/features/hashes_list/domain/entities/snapshot.g.dart +++ b/lib/features/hashes_list/domain/entities/snapshot.g.dart @@ -7,19 +7,19 @@ part of 'snapshot.dart'; // ************************************************************************** abstract class _$SnapshotCWProxy { - Snapshot externalPathToObj(String? externalPathToObj); + Snapshot name(String name); - Snapshot fileHash(int fileHash); + Snapshot stamp(DateTime stamp); Snapshot hashes(List hashes); - Snapshot name(String name); + Snapshot settingsConfig(ScanSettings settingsConfig); - Snapshot relativePath(String? relativePath); + Snapshot fileHash(int fileHash); - Snapshot settingsConfig(ScanSettings settingsConfig); + Snapshot relativePath(String? relativePath); - Snapshot stamp(DateTime stamp); + Snapshot externalPathToObj(String? externalPathToObj); /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Snapshot(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// @@ -28,45 +28,45 @@ abstract class _$SnapshotCWProxy { /// Snapshot(...).copyWith(id: 12, name: "My name") /// ```` Snapshot call({ - String? externalPathToObj, - int? fileHash, - List? hashes, String? name, - String? relativePath, - ScanSettings? settingsConfig, DateTime? stamp, + List? hashes, + ScanSettings? settingsConfig, + int? fileHash, + String? relativePath, + String? externalPathToObj, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSnapshot.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSnapshot.copyWith.fieldName(...)` class _$SnapshotCWProxyImpl implements _$SnapshotCWProxy { - final Snapshot _value; - const _$SnapshotCWProxyImpl(this._value); + final Snapshot _value; + @override - Snapshot externalPathToObj(String? externalPathToObj) => - this(externalPathToObj: externalPathToObj); + Snapshot name(String name) => this(name: name); @override - Snapshot fileHash(int fileHash) => this(fileHash: fileHash); + Snapshot stamp(DateTime stamp) => this(stamp: stamp); @override Snapshot hashes(List hashes) => this(hashes: hashes); @override - Snapshot name(String name) => this(name: name); + Snapshot settingsConfig(ScanSettings settingsConfig) => + this(settingsConfig: settingsConfig); @override - Snapshot relativePath(String? relativePath) => - this(relativePath: relativePath); + Snapshot fileHash(int fileHash) => this(fileHash: fileHash); @override - Snapshot settingsConfig(ScanSettings settingsConfig) => - this(settingsConfig: settingsConfig); + Snapshot relativePath(String? relativePath) => + this(relativePath: relativePath); @override - Snapshot stamp(DateTime stamp) => this(stamp: stamp); + Snapshot externalPathToObj(String? externalPathToObj) => + this(externalPathToObj: externalPathToObj); @override @@ -77,44 +77,44 @@ class _$SnapshotCWProxyImpl implements _$SnapshotCWProxy { /// Snapshot(...).copyWith(id: 12, name: "My name") /// ```` Snapshot call({ - Object? externalPathToObj = const $CopyWithPlaceholder(), - Object? fileHash = const $CopyWithPlaceholder(), - Object? hashes = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), - Object? relativePath = const $CopyWithPlaceholder(), - Object? settingsConfig = const $CopyWithPlaceholder(), Object? stamp = const $CopyWithPlaceholder(), + Object? hashes = const $CopyWithPlaceholder(), + Object? settingsConfig = const $CopyWithPlaceholder(), + Object? fileHash = const $CopyWithPlaceholder(), + Object? relativePath = const $CopyWithPlaceholder(), + Object? externalPathToObj = const $CopyWithPlaceholder(), }) { return Snapshot( - externalPathToObj: externalPathToObj == const $CopyWithPlaceholder() - ? _value.externalPathToObj + name: name == const $CopyWithPlaceholder() || name == null + ? _value.name // ignore: cast_nullable_to_non_nullable - : externalPathToObj as String?, - fileHash: fileHash == const $CopyWithPlaceholder() || fileHash == null - ? _value.fileHash + : name as String, + stamp: stamp == const $CopyWithPlaceholder() || stamp == null + ? _value.stamp // ignore: cast_nullable_to_non_nullable - : fileHash as int, + : stamp as DateTime, hashes: hashes == const $CopyWithPlaceholder() || hashes == null ? _value.hashes // ignore: cast_nullable_to_non_nullable : hashes as List, - name: name == const $CopyWithPlaceholder() || name == null - ? _value.name - // ignore: cast_nullable_to_non_nullable - : name as String, - relativePath: relativePath == const $CopyWithPlaceholder() - ? _value.relativePath - // ignore: cast_nullable_to_non_nullable - : relativePath as String?, settingsConfig: settingsConfig == const $CopyWithPlaceholder() || settingsConfig == null ? _value.settingsConfig // ignore: cast_nullable_to_non_nullable : settingsConfig as ScanSettings, - stamp: stamp == const $CopyWithPlaceholder() || stamp == null - ? _value.stamp + fileHash: fileHash == const $CopyWithPlaceholder() || fileHash == null + ? _value.fileHash // ignore: cast_nullable_to_non_nullable - : stamp as DateTime, + : fileHash as int, + relativePath: relativePath == const $CopyWithPlaceholder() + ? _value.relativePath + // ignore: cast_nullable_to_non_nullable + : relativePath as String?, + externalPathToObj: externalPathToObj == const $CopyWithPlaceholder() + ? _value.externalPathToObj + // ignore: cast_nullable_to_non_nullable + : externalPathToObj as String?, ); } } diff --git a/lib/features/settings_page/domain/entities/app_settings.g.dart b/lib/features/settings_page/domain/entities/app_settings.g.dart index 4a8bf9b1..b7901064 100644 --- a/lib/features/settings_page/domain/entities/app_settings.g.dart +++ b/lib/features/settings_page/domain/entities/app_settings.g.dart @@ -9,11 +9,11 @@ part of 'app_settings.dart'; abstract class _$AppSettingsCWProxy { AppSettings darkTheme(bool darkTheme); - AppSettings pinCode(String pinCode); + AppSettings stableRequirement(int stableRequirement); AppSettings showZeroAssets(bool showZeroAssets); - AppSettings stableRequirement(int stableRequirement); + AppSettings pinCode(String pinCode); /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AppSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// @@ -23,31 +23,31 @@ abstract class _$AppSettingsCWProxy { /// ```` AppSettings call({ bool? darkTheme, - String? pinCode, - bool? showZeroAssets, int? stableRequirement, + bool? showZeroAssets, + String? pinCode, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAppSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAppSettings.copyWith.fieldName(...)` class _$AppSettingsCWProxyImpl implements _$AppSettingsCWProxy { - final AppSettings _value; - const _$AppSettingsCWProxyImpl(this._value); + final AppSettings _value; + @override AppSettings darkTheme(bool darkTheme) => this(darkTheme: darkTheme); @override - AppSettings pinCode(String pinCode) => this(pinCode: pinCode); + AppSettings stableRequirement(int stableRequirement) => + this(stableRequirement: stableRequirement); @override AppSettings showZeroAssets(bool showZeroAssets) => this(showZeroAssets: showZeroAssets); @override - AppSettings stableRequirement(int stableRequirement) => - this(stableRequirement: stableRequirement); + AppSettings pinCode(String pinCode) => this(pinCode: pinCode); @override @@ -59,29 +59,29 @@ class _$AppSettingsCWProxyImpl implements _$AppSettingsCWProxy { /// ```` AppSettings call({ Object? darkTheme = const $CopyWithPlaceholder(), - Object? pinCode = const $CopyWithPlaceholder(), - Object? showZeroAssets = const $CopyWithPlaceholder(), Object? stableRequirement = const $CopyWithPlaceholder(), + Object? showZeroAssets = const $CopyWithPlaceholder(), + Object? pinCode = const $CopyWithPlaceholder(), }) { return AppSettings( darkTheme: darkTheme == const $CopyWithPlaceholder() || darkTheme == null ? _value.darkTheme // ignore: cast_nullable_to_non_nullable : darkTheme as bool, - pinCode: pinCode == const $CopyWithPlaceholder() || pinCode == null - ? _value.pinCode + stableRequirement: stableRequirement == const $CopyWithPlaceholder() || + stableRequirement == null + ? _value.stableRequirement // ignore: cast_nullable_to_non_nullable - : pinCode as String, + : stableRequirement as int, showZeroAssets: showZeroAssets == const $CopyWithPlaceholder() || showZeroAssets == null ? _value.showZeroAssets // ignore: cast_nullable_to_non_nullable : showZeroAssets as bool, - stableRequirement: stableRequirement == const $CopyWithPlaceholder() || - stableRequirement == null - ? _value.stableRequirement + pinCode: pinCode == const $CopyWithPlaceholder() || pinCode == null + ? _value.pinCode // ignore: cast_nullable_to_non_nullable - : stableRequirement as int, + : pinCode as String, ); } } diff --git a/lib/features/settings_page/domain/entities/global_settings.g.dart b/lib/features/settings_page/domain/entities/global_settings.g.dart index 10395ff9..8dca14bc 100644 --- a/lib/features/settings_page/domain/entities/global_settings.g.dart +++ b/lib/features/settings_page/domain/entities/global_settings.g.dart @@ -7,14 +7,14 @@ part of 'global_settings.dart'; // ************************************************************************** abstract class _$GlobalSettingsCWProxy { - GlobalSettings appSettings(AppSettings appSettings); - - GlobalSettings previewSettings(PreviewSettings previewSettings); - GlobalSettings scanSettings(ScanSettings scanSettings); GlobalSettings walletSettings(WalletSettings walletSettings); + GlobalSettings previewSettings(PreviewSettings previewSettings); + + GlobalSettings appSettings(AppSettings appSettings); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GlobalSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -22,26 +22,18 @@ abstract class _$GlobalSettingsCWProxy { /// GlobalSettings(...).copyWith(id: 12, name: "My name") /// ```` GlobalSettings call({ - AppSettings? appSettings, - PreviewSettings? previewSettings, ScanSettings? scanSettings, WalletSettings? walletSettings, + PreviewSettings? previewSettings, + AppSettings? appSettings, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGlobalSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGlobalSettings.copyWith.fieldName(...)` class _$GlobalSettingsCWProxyImpl implements _$GlobalSettingsCWProxy { - final GlobalSettings _value; - const _$GlobalSettingsCWProxyImpl(this._value); - @override - GlobalSettings appSettings(AppSettings appSettings) => - this(appSettings: appSettings); - - @override - GlobalSettings previewSettings(PreviewSettings previewSettings) => - this(previewSettings: previewSettings); + final GlobalSettings _value; @override GlobalSettings scanSettings(ScanSettings scanSettings) => @@ -51,6 +43,14 @@ class _$GlobalSettingsCWProxyImpl implements _$GlobalSettingsCWProxy { GlobalSettings walletSettings(WalletSettings walletSettings) => this(walletSettings: walletSettings); + @override + GlobalSettings previewSettings(PreviewSettings previewSettings) => + this(previewSettings: previewSettings); + + @override + GlobalSettings appSettings(AppSettings appSettings) => + this(appSettings: appSettings); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GlobalSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -60,22 +60,12 @@ class _$GlobalSettingsCWProxyImpl implements _$GlobalSettingsCWProxy { /// GlobalSettings(...).copyWith(id: 12, name: "My name") /// ```` GlobalSettings call({ - Object? appSettings = const $CopyWithPlaceholder(), - Object? previewSettings = const $CopyWithPlaceholder(), Object? scanSettings = const $CopyWithPlaceholder(), Object? walletSettings = const $CopyWithPlaceholder(), + Object? previewSettings = const $CopyWithPlaceholder(), + Object? appSettings = const $CopyWithPlaceholder(), }) { return GlobalSettings( - appSettings: - appSettings == const $CopyWithPlaceholder() || appSettings == null - ? _value.appSettings - // ignore: cast_nullable_to_non_nullable - : appSettings as AppSettings, - previewSettings: previewSettings == const $CopyWithPlaceholder() || - previewSettings == null - ? _value.previewSettings - // ignore: cast_nullable_to_non_nullable - : previewSettings as PreviewSettings, scanSettings: scanSettings == const $CopyWithPlaceholder() || scanSettings == null ? _value.scanSettings @@ -86,6 +76,16 @@ class _$GlobalSettingsCWProxyImpl implements _$GlobalSettingsCWProxy { ? _value.walletSettings // ignore: cast_nullable_to_non_nullable : walletSettings as WalletSettings, + previewSettings: previewSettings == const $CopyWithPlaceholder() || + previewSettings == null + ? _value.previewSettings + // ignore: cast_nullable_to_non_nullable + : previewSettings as PreviewSettings, + appSettings: + appSettings == const $CopyWithPlaceholder() || appSettings == null + ? _value.appSettings + // ignore: cast_nullable_to_non_nullable + : appSettings as AppSettings, ); } } diff --git a/lib/features/settings_page/domain/entities/preview_settings.g.dart b/lib/features/settings_page/domain/entities/preview_settings.g.dart index 22a53959..8be6f968 100644 --- a/lib/features/settings_page/domain/entities/preview_settings.g.dart +++ b/lib/features/settings_page/domain/entities/preview_settings.g.dart @@ -7,10 +7,10 @@ part of 'preview_settings.dart'; // ************************************************************************** abstract class _$PreviewSettingsCWProxy { - PreviewSettings antialias(bool antialias); - PreviewSettings pixelRatio(double pixelRatio); + PreviewSettings antialias(bool antialias); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PreviewSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -18,23 +18,23 @@ abstract class _$PreviewSettingsCWProxy { /// PreviewSettings(...).copyWith(id: 12, name: "My name") /// ```` PreviewSettings call({ - bool? antialias, double? pixelRatio, + bool? antialias, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPreviewSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPreviewSettings.copyWith.fieldName(...)` class _$PreviewSettingsCWProxyImpl implements _$PreviewSettingsCWProxy { - final PreviewSettings _value; - const _$PreviewSettingsCWProxyImpl(this._value); - @override - PreviewSettings antialias(bool antialias) => this(antialias: antialias); + final PreviewSettings _value; @override PreviewSettings pixelRatio(double pixelRatio) => this(pixelRatio: pixelRatio); + @override + PreviewSettings antialias(bool antialias) => this(antialias: antialias); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PreviewSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -44,19 +44,19 @@ class _$PreviewSettingsCWProxyImpl implements _$PreviewSettingsCWProxy { /// PreviewSettings(...).copyWith(id: 12, name: "My name") /// ```` PreviewSettings call({ - Object? antialias = const $CopyWithPlaceholder(), Object? pixelRatio = const $CopyWithPlaceholder(), + Object? antialias = const $CopyWithPlaceholder(), }) { return PreviewSettings( - antialias: antialias == const $CopyWithPlaceholder() || antialias == null - ? _value.antialias - // ignore: cast_nullable_to_non_nullable - : antialias as bool, pixelRatio: pixelRatio == const $CopyWithPlaceholder() || pixelRatio == null ? _value.pixelRatio // ignore: cast_nullable_to_non_nullable : pixelRatio as double, + antialias: antialias == const $CopyWithPlaceholder() || antialias == null + ? _value.antialias + // ignore: cast_nullable_to_non_nullable + : antialias as bool, ); } } diff --git a/lib/features/settings_page/domain/entities/scan_settings.g.dart b/lib/features/settings_page/domain/entities/scan_settings.g.dart index 768945de..7308c985 100644 --- a/lib/features/settings_page/domain/entities/scan_settings.g.dart +++ b/lib/features/settings_page/domain/entities/scan_settings.g.dart @@ -7,14 +7,14 @@ part of 'scan_settings.dart'; // ************************************************************************** abstract class _$ScanSettingsCWProxy { - ScanSettings algorithm(String algorithm); - ScanSettings gridSize(int gridSize); - ScanSettings libVersion(String libVersion); - ScanSettings nSections(int nSections); + ScanSettings algorithm(String algorithm); + + ScanSettings libVersion(String libVersion); + ScanSettings transBytes(String transBytes); /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScanSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -24,31 +24,31 @@ abstract class _$ScanSettingsCWProxy { /// ScanSettings(...).copyWith(id: 12, name: "My name") /// ```` ScanSettings call({ - String? algorithm, int? gridSize, - String? libVersion, int? nSections, + String? algorithm, + String? libVersion, String? transBytes, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfScanSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfScanSettings.copyWith.fieldName(...)` class _$ScanSettingsCWProxyImpl implements _$ScanSettingsCWProxy { - final ScanSettings _value; - const _$ScanSettingsCWProxyImpl(this._value); - @override - ScanSettings algorithm(String algorithm) => this(algorithm: algorithm); + final ScanSettings _value; @override ScanSettings gridSize(int gridSize) => this(gridSize: gridSize); @override - ScanSettings libVersion(String libVersion) => this(libVersion: libVersion); + ScanSettings nSections(int nSections) => this(nSections: nSections); @override - ScanSettings nSections(int nSections) => this(nSections: nSections); + ScanSettings algorithm(String algorithm) => this(algorithm: algorithm); + + @override + ScanSettings libVersion(String libVersion) => this(libVersion: libVersion); @override ScanSettings transBytes(String transBytes) => this(transBytes: transBytes); @@ -62,30 +62,30 @@ class _$ScanSettingsCWProxyImpl implements _$ScanSettingsCWProxy { /// ScanSettings(...).copyWith(id: 12, name: "My name") /// ```` ScanSettings call({ - Object? algorithm = const $CopyWithPlaceholder(), Object? gridSize = const $CopyWithPlaceholder(), - Object? libVersion = const $CopyWithPlaceholder(), Object? nSections = const $CopyWithPlaceholder(), + Object? algorithm = const $CopyWithPlaceholder(), + Object? libVersion = const $CopyWithPlaceholder(), Object? transBytes = const $CopyWithPlaceholder(), }) { return ScanSettings( - algorithm: algorithm == const $CopyWithPlaceholder() || algorithm == null - ? _value.algorithm - // ignore: cast_nullable_to_non_nullable - : algorithm as String, gridSize: gridSize == const $CopyWithPlaceholder() || gridSize == null ? _value.gridSize // ignore: cast_nullable_to_non_nullable : gridSize as int, + nSections: nSections == const $CopyWithPlaceholder() || nSections == null + ? _value.nSections + // ignore: cast_nullable_to_non_nullable + : nSections as int, + algorithm: algorithm == const $CopyWithPlaceholder() || algorithm == null + ? _value.algorithm + // ignore: cast_nullable_to_non_nullable + : algorithm as String, libVersion: libVersion == const $CopyWithPlaceholder() || libVersion == null ? _value.libVersion // ignore: cast_nullable_to_non_nullable : libVersion as String, - nSections: nSections == const $CopyWithPlaceholder() || nSections == null - ? _value.nSections - // ignore: cast_nullable_to_non_nullable - : nSections as int, transBytes: transBytes == const $CopyWithPlaceholder() || transBytes == null ? _value.transBytes diff --git a/lib/features/settings_page/domain/entities/wallet_settings.g.dart b/lib/features/settings_page/domain/entities/wallet_settings.g.dart index 2084afde..690e05ce 100644 --- a/lib/features/settings_page/domain/entities/wallet_settings.g.dart +++ b/lib/features/settings_page/domain/entities/wallet_settings.g.dart @@ -25,10 +25,10 @@ abstract class _$WalletSettingsCWProxy { /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfWalletSettings.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfWalletSettings.copyWith.fieldName(...)` class _$WalletSettingsCWProxyImpl implements _$WalletSettingsCWProxy { - final WalletSettings _value; - const _$WalletSettingsCWProxyImpl(this._value); + final WalletSettings _value; + @override WalletSettings isTestNet(bool isTestNet) => this(isTestNet: isTestNet); diff --git a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart index 0adac0cd..4294c1a5 100644 --- a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart +++ b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart @@ -1,19 +1,31 @@ +import 'package:copy_with_extension/copy_with_extension.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:polkawallet_sdk/api/types/txInfoData.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; +import 'package:threedpass/core/polkawallet/utils/transfer_type.dart'; import 'package:threedpass/features/wallet_screen/domain/entities/transfer.dart'; import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart'; +part 'transfer_info_cubit.g.dart'; + class TransferInfoCubit extends Cubit { TransferInfoCubit({ required final String balance, required this.metaDTO, - }) : super(TransferInfo(balance: balance, fees: null)); + required this.appService, + }) : super( + TransferInfo( + balance: balance, + fees: null, + type: TransferTypeValue.defaultType, + ), + ); final TransferMetaDTO metaDTO; + final AppService appService; - Future init(final AppService appService) async { + Future init() async { final params = [ appService.keyring.allWithContacts.first.address, '10000000000', @@ -21,7 +33,7 @@ class TransferInfoCubit extends Cubit { final txInfo = TxInfoData( 'balances', - 'transferKeepAlive', + TransferTypeValue(state.type).toString(), appService.userSenderData, ); @@ -30,27 +42,26 @@ class TransferInfoCubit extends Cubit { // Firstly there were wring types in dart code. // I fixed them here: https://github.com/L3odr0id/polkawallet_sdk/commit/ccafe364cb231c7d1888648257f5f3002ebb8b2b // But it turned out that there is a problem with the JS code deep inside. - final fee = await appService.plugin.sdk.api.tx.estimateFees(txInfo, params); - print(appService.networkStateData.tokenDecimals); - print(fee.partialFee); - print(fee.weight); - // TODO Add fees - final b = 1 + 1; - emit(TransferInfo(balance: state.balance, fees: fee)); + // final fee = await appService.plugin.sdk.api.tx.estimateFees(txInfo, params); + // print(appService.networkStateData.tokenDecimals); + // print(fee.partialFee); + // print(fee.weight); + // // TODO Add fees + // final b = 1 + 1; + + // emit(state.copyWith(fees: fee)); } Future sendTransfer({ - required final AppService appService, required final String amount, required final String toAddress, required final BuildContext context, required final String password, required final GlobalKey formKey, }) async { - final txInfo = metaDTO.getTxInfo(appService); + final txInfo = metaDTO.getTxInfo(state.type); final params = metaDTO.getParams( - appService, amount, toAddress, ); @@ -58,7 +69,6 @@ class TransferInfoCubit extends Cubit { await Transfer( txInfo: txInfo, params: params, - // amount: amountController.text, appService: appService, context: context, toAddress: toAddress, @@ -66,15 +76,22 @@ class TransferInfoCubit extends Cubit { formKey: formKey, ).sendFunds(); } + + void updateTransferType(final TransferType type) { + emit(state.copyWith(type: type)); + } } +@CopyWith() class TransferInfo { // Max avaliable balance in wallet in human-readable double format final String balance; final TxFeeEstimateResult? fees; + final TransferType type; const TransferInfo({ required this.balance, required this.fees, + required this.type, }); } diff --git a/lib/features/wallet_screen/bloc/transfer_info_cubit.g.dart b/lib/features/wallet_screen/bloc/transfer_info_cubit.g.dart new file mode 100644 index 00000000..ec765495 --- /dev/null +++ b/lib/features/wallet_screen/bloc/transfer_info_cubit.g.dart @@ -0,0 +1,78 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'transfer_info_cubit.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TransferInfoCWProxy { + TransferInfo balance(String balance); + + TransferInfo fees(TxFeeEstimateResult? fees); + + TransferInfo type(TransferType type); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransferInfo(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TransferInfo(...).copyWith(id: 12, name: "My name") + /// ```` + TransferInfo call({ + String? balance, + TxFeeEstimateResult? fees, + TransferType? type, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTransferInfo.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTransferInfo.copyWith.fieldName(...)` +class _$TransferInfoCWProxyImpl implements _$TransferInfoCWProxy { + const _$TransferInfoCWProxyImpl(this._value); + + final TransferInfo _value; + + @override + TransferInfo balance(String balance) => this(balance: balance); + + @override + TransferInfo fees(TxFeeEstimateResult? fees) => this(fees: fees); + + @override + TransferInfo type(TransferType type) => this(type: type); + + @override + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransferInfo(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TransferInfo(...).copyWith(id: 12, name: "My name") + /// ```` + TransferInfo call({ + Object? balance = const $CopyWithPlaceholder(), + Object? fees = const $CopyWithPlaceholder(), + Object? type = const $CopyWithPlaceholder(), + }) { + return TransferInfo( + balance: balance == const $CopyWithPlaceholder() || balance == null + ? _value.balance + // ignore: cast_nullable_to_non_nullable + : balance as String, + fees: fees == const $CopyWithPlaceholder() + ? _value.fees + // ignore: cast_nullable_to_non_nullable + : fees as TxFeeEstimateResult?, + type: type == const $CopyWithPlaceholder() || type == null + ? _value.type + // ignore: cast_nullable_to_non_nullable + : type as TransferType, + ); + } +} + +extension $TransferInfoCopyWith on TransferInfo { + /// Returns a callable class that can be used as follows: `instanceOfTransferInfo.copyWith(...)` or like so:`instanceOfTransferInfo.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TransferInfoCWProxy get copyWith => _$TransferInfoCWProxyImpl(this); +} diff --git a/lib/features/wallet_screen/domain/entities/transfer.dart b/lib/features/wallet_screen/domain/entities/transfer.dart index d688e798..f646b879 100644 --- a/lib/features/wallet_screen/domain/entities/transfer.dart +++ b/lib/features/wallet_screen/domain/entities/transfer.dart @@ -9,9 +9,7 @@ import 'package:polkawallet_sdk/api/types/txInfoData.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; import 'package:threedpass/core/widgets/default_loading_dialog.dart'; import 'package:threedpass/features/home_page/bloc/home_context_cubit.dart'; -import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart'; -// TODO Add transfer options: keep_alive or just transfer class Transfer { const Transfer({ required this.txInfo, diff --git a/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart b/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart index f2fe868e..bf6346d6 100644 --- a/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart +++ b/lib/features/wallet_screen/domain/entities/transfer_meta_dto.dart @@ -3,18 +3,18 @@ import 'package:polkawallet_sdk/plugin/store/balances.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; import 'package:threedpass/core/polkawallet/utils/balance_utils.dart'; import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart'; +import 'package:threedpass/core/polkawallet/utils/transfer_type.dart'; import 'package:threedpass/core/polkawallet/utils/tx_info.dart'; abstract class TransferMetaDTO { const TransferMetaDTO(); MetaInfoType get type; - String getBalance(final AppService appService); + String getBalance(); String getName(); - TxInfoData getTxInfo(final AppService appService); + TxInfoData getTxInfo(final TransferType transferType); List getParams( - final AppService appService, final String? amount, final String toAddress, ); @@ -22,16 +22,21 @@ abstract class TransferMetaDTO { class CoinsTransferMetaDTO extends TransferMetaDTO { final String coinName; + final CoinsTransferTx txInfoValue; + final AppService appService; - const CoinsTransferMetaDTO({ + CoinsTransferMetaDTO({ required this.coinName, - }); + required this.appService, + }) : txInfoValue = CoinsTransferTx( + appService: appService, + ); @override MetaInfoType get type => MetaInfoType.coin; @override - String getBalance(final AppService appService) { + String getBalance() { return BalanceUtils.balance( appService.chosenAccountBalance.value.availableBalance as String?, appService.networkStateData.safeDecimals, @@ -44,32 +49,36 @@ class CoinsTransferMetaDTO extends TransferMetaDTO { } @override - TxInfoData getTxInfo(final AppService appService) { - return CoinsTransferTx(appService: appService).txInfo; + TxInfoData getTxInfo(final TransferType transferType) { + return txInfoValue.txInfo(transferType); } @override List getParams( - final AppService appService, final String? amount, final String toAddress, ) { - return CoinsTransferTx(appService: appService).params(amount, toAddress); + return txInfoValue.params(amount, toAddress); } } class AssetTransferMetaDTO extends TransferMetaDTO { final TokenBalanceData tokenBalanceData; + final AssetsTransferTx txInfoValue; - const AssetTransferMetaDTO({ + AssetTransferMetaDTO({ required this.tokenBalanceData, - }); + required final AppService appService, + }) : txInfoValue = AssetsTransferTx( + appService: appService, + tokenBalanceData: tokenBalanceData, + ); @override MetaInfoType get type => MetaInfoType.asset; @override - String getBalance(final AppService appService) { + String getBalance() { return BalanceUtils.balance( tokenBalanceData.amount, tokenBalanceData.decimals ?? 12, @@ -82,23 +91,16 @@ class AssetTransferMetaDTO extends TransferMetaDTO { } @override - TxInfoData getTxInfo(final AppService appService) { - return AssetsTransferTx( - appService: appService, - tokenBalanceData: tokenBalanceData, - ).txInfo; + TxInfoData getTxInfo(final TransferType transferType) { + return txInfoValue.txInfo(transferType); } @override List getParams( - final AppService appService, final String? amount, final String toAddress, ) { - return AssetsTransferTx( - appService: appService, - tokenBalanceData: tokenBalanceData, - ).params(amount, toAddress); + return txInfoValue.params(amount, toAddress); } } diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart index cbab933b..1752e01d 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart'; import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/recieve_button.dart'; -import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/transfer_button.dart'; class AssetPageButtonsPanel extends StatelessWidget { const AssetPageButtonsPanel({super.key}); diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/transfer_button.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart similarity index 97% rename from lib/features/wallet_screen/presentation/assets_page/widgets/transfer_button.dart rename to lib/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart index 5c2fd160..34fe91d4 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/transfer_button.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart @@ -18,6 +18,7 @@ class CoinTransferButton extends StatelessWidget { TransferRouteWrapper( metadata: CoinsTransferMetaDTO( coinName: appService.networkStateData.tokenSymbol?.first ?? '', + appService: appService, ), ), ); diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart index d6ef79f7..4d029477 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart @@ -71,7 +71,7 @@ class AssetsGetExtrinsicsCubit extends Cubit { ); } pagingController.itemList = list; - pagingController.notifyListeners(); + // pagingController.notifyListeners(); // print('${item.blockDatetime} ${item.runtimeType}'); }, ); diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart index 7750f817..709b0cf8 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart @@ -7,16 +7,16 @@ part of 'asset_history_create.dart'; // ************************************************************************** abstract class _$AssetHistoryCreateCWProxy { - AssetHistoryCreate authorAddress(String authorAddress); - AssetHistoryCreate blockDatetime(DateTime blockDatetime); - AssetHistoryCreate blockNumber(int blockNumber); - AssetHistoryCreate extrinsicIdx(int extrinsicIdx); + AssetHistoryCreate authorAddress(String authorAddress); + AssetHistoryCreate extrisincStatus(ExtrisincStatus extrisincStatus); + AssetHistoryCreate blockNumber(int blockNumber); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistoryCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -24,40 +24,40 @@ abstract class _$AssetHistoryCreateCWProxy { /// AssetHistoryCreate(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryCreate call({ - String? authorAddress, DateTime? blockDatetime, - int? blockNumber, int? extrinsicIdx, + String? authorAddress, ExtrisincStatus? extrisincStatus, + int? blockNumber, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAssetHistoryCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAssetHistoryCreate.copyWith.fieldName(...)` class _$AssetHistoryCreateCWProxyImpl implements _$AssetHistoryCreateCWProxy { - final AssetHistoryCreate _value; - const _$AssetHistoryCreateCWProxyImpl(this._value); - @override - AssetHistoryCreate authorAddress(String authorAddress) => - this(authorAddress: authorAddress); + final AssetHistoryCreate _value; @override AssetHistoryCreate blockDatetime(DateTime blockDatetime) => this(blockDatetime: blockDatetime); - @override - AssetHistoryCreate blockNumber(int blockNumber) => - this(blockNumber: blockNumber); - @override AssetHistoryCreate extrinsicIdx(int extrinsicIdx) => this(extrinsicIdx: extrinsicIdx); + @override + AssetHistoryCreate authorAddress(String authorAddress) => + this(authorAddress: authorAddress); + @override AssetHistoryCreate extrisincStatus(ExtrisincStatus extrisincStatus) => this(extrisincStatus: extrisincStatus); + @override + AssetHistoryCreate blockNumber(int blockNumber) => + this(blockNumber: blockNumber); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistoryCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -67,38 +67,38 @@ class _$AssetHistoryCreateCWProxyImpl implements _$AssetHistoryCreateCWProxy { /// AssetHistoryCreate(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryCreate call({ - Object? authorAddress = const $CopyWithPlaceholder(), Object? blockDatetime = const $CopyWithPlaceholder(), - Object? blockNumber = const $CopyWithPlaceholder(), Object? extrinsicIdx = const $CopyWithPlaceholder(), + Object? authorAddress = const $CopyWithPlaceholder(), Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? blockNumber = const $CopyWithPlaceholder(), }) { return AssetHistoryCreate( - authorAddress: - authorAddress == const $CopyWithPlaceholder() || authorAddress == null - ? _value.authorAddress - // ignore: cast_nullable_to_non_nullable - : authorAddress as String, blockDatetime: blockDatetime == const $CopyWithPlaceholder() || blockDatetime == null ? _value.blockDatetime // ignore: cast_nullable_to_non_nullable : blockDatetime as DateTime, - blockNumber: - blockNumber == const $CopyWithPlaceholder() || blockNumber == null - ? _value.blockNumber - // ignore: cast_nullable_to_non_nullable - : blockNumber as int, extrinsicIdx: extrinsicIdx == const $CopyWithPlaceholder() || extrinsicIdx == null ? _value.extrinsicIdx // ignore: cast_nullable_to_non_nullable : extrinsicIdx as int, + authorAddress: + authorAddress == const $CopyWithPlaceholder() || authorAddress == null + ? _value.authorAddress + // ignore: cast_nullable_to_non_nullable + : authorAddress as String, extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || extrisincStatus == null ? _value.extrisincStatus // ignore: cast_nullable_to_non_nullable : extrisincStatus as ExtrisincStatus, + blockNumber: + blockNumber == const $CopyWithPlaceholder() || blockNumber == null + ? _value.blockNumber + // ignore: cast_nullable_to_non_nullable + : blockNumber as int, ); } } diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart index aacabec6..7f3d4297 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart @@ -7,18 +7,18 @@ part of 'asset_history_mint.dart'; // ************************************************************************** abstract class _$AssetHistoryMintCWProxy { - AssetHistoryMint authorAddress(String authorAddress); - AssetHistoryMint blockDatetime(DateTime blockDatetime); - AssetHistoryMint blockNumber(int blockNumber); - AssetHistoryMint extrinsicIdx(int extrinsicIdx); - AssetHistoryMint extrisincStatus(ExtrisincStatus extrisincStatus); + AssetHistoryMint authorAddress(String authorAddress); AssetHistoryMint value(String value); + AssetHistoryMint extrisincStatus(ExtrisincStatus extrisincStatus); + + AssetHistoryMint blockNumber(int blockNumber); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistoryMint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -26,43 +26,43 @@ abstract class _$AssetHistoryMintCWProxy { /// AssetHistoryMint(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryMint call({ - String? authorAddress, DateTime? blockDatetime, - int? blockNumber, int? extrinsicIdx, - ExtrisincStatus? extrisincStatus, + String? authorAddress, String? value, + ExtrisincStatus? extrisincStatus, + int? blockNumber, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAssetHistoryMint.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAssetHistoryMint.copyWith.fieldName(...)` class _$AssetHistoryMintCWProxyImpl implements _$AssetHistoryMintCWProxy { - final AssetHistoryMint _value; - const _$AssetHistoryMintCWProxyImpl(this._value); - @override - AssetHistoryMint authorAddress(String authorAddress) => - this(authorAddress: authorAddress); + final AssetHistoryMint _value; @override AssetHistoryMint blockDatetime(DateTime blockDatetime) => this(blockDatetime: blockDatetime); - @override - AssetHistoryMint blockNumber(int blockNumber) => - this(blockNumber: blockNumber); - @override AssetHistoryMint extrinsicIdx(int extrinsicIdx) => this(extrinsicIdx: extrinsicIdx); + @override + AssetHistoryMint authorAddress(String authorAddress) => + this(authorAddress: authorAddress); + + @override + AssetHistoryMint value(String value) => this(value: value); + @override AssetHistoryMint extrisincStatus(ExtrisincStatus extrisincStatus) => this(extrisincStatus: extrisincStatus); @override - AssetHistoryMint value(String value) => this(value: value); + AssetHistoryMint blockNumber(int blockNumber) => + this(blockNumber: blockNumber); @override @@ -73,43 +73,43 @@ class _$AssetHistoryMintCWProxyImpl implements _$AssetHistoryMintCWProxy { /// AssetHistoryMint(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryMint call({ - Object? authorAddress = const $CopyWithPlaceholder(), Object? blockDatetime = const $CopyWithPlaceholder(), - Object? blockNumber = const $CopyWithPlaceholder(), Object? extrinsicIdx = const $CopyWithPlaceholder(), - Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? authorAddress = const $CopyWithPlaceholder(), Object? value = const $CopyWithPlaceholder(), + Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? blockNumber = const $CopyWithPlaceholder(), }) { return AssetHistoryMint( - authorAddress: - authorAddress == const $CopyWithPlaceholder() || authorAddress == null - ? _value.authorAddress - // ignore: cast_nullable_to_non_nullable - : authorAddress as String, blockDatetime: blockDatetime == const $CopyWithPlaceholder() || blockDatetime == null ? _value.blockDatetime // ignore: cast_nullable_to_non_nullable : blockDatetime as DateTime, - blockNumber: - blockNumber == const $CopyWithPlaceholder() || blockNumber == null - ? _value.blockNumber - // ignore: cast_nullable_to_non_nullable - : blockNumber as int, extrinsicIdx: extrinsicIdx == const $CopyWithPlaceholder() || extrinsicIdx == null ? _value.extrinsicIdx // ignore: cast_nullable_to_non_nullable : extrinsicIdx as int, + authorAddress: + authorAddress == const $CopyWithPlaceholder() || authorAddress == null + ? _value.authorAddress + // ignore: cast_nullable_to_non_nullable + : authorAddress as String, + value: value == const $CopyWithPlaceholder() || value == null + ? _value.value + // ignore: cast_nullable_to_non_nullable + : value as String, extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || extrisincStatus == null ? _value.extrisincStatus // ignore: cast_nullable_to_non_nullable : extrisincStatus as ExtrisincStatus, - value: value == const $CopyWithPlaceholder() || value == null - ? _value.value - // ignore: cast_nullable_to_non_nullable - : value as String, + blockNumber: + blockNumber == const $CopyWithPlaceholder() || blockNumber == null + ? _value.blockNumber + // ignore: cast_nullable_to_non_nullable + : blockNumber as int, ); } } diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart index c4a2ec7d..847b2bcb 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart @@ -7,22 +7,22 @@ part of 'asset_history_set_meta_data.dart'; // ************************************************************************** abstract class _$AssetHistorySetMetadataCWProxy { - AssetHistorySetMetadata authorAddress(String authorAddress); - AssetHistorySetMetadata blockDatetime(DateTime blockDatetime); - AssetHistorySetMetadata blockNumber(int blockNumber); - - AssetHistorySetMetadata decimals(String decimals); - AssetHistorySetMetadata extrinsicIdx(int extrinsicIdx); - AssetHistorySetMetadata extrisincStatus(ExtrisincStatus extrisincStatus); + AssetHistorySetMetadata authorAddress(String authorAddress); + + AssetHistorySetMetadata decimals(String decimals); AssetHistorySetMetadata name(String name); AssetHistorySetMetadata symbol(String symbol); + AssetHistorySetMetadata extrisincStatus(ExtrisincStatus extrisincStatus); + + AssetHistorySetMetadata blockNumber(int blockNumber); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistorySetMetadata(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -30,52 +30,52 @@ abstract class _$AssetHistorySetMetadataCWProxy { /// AssetHistorySetMetadata(...).copyWith(id: 12, name: "My name") /// ```` AssetHistorySetMetadata call({ - String? authorAddress, DateTime? blockDatetime, - int? blockNumber, - String? decimals, int? extrinsicIdx, - ExtrisincStatus? extrisincStatus, + String? authorAddress, + String? decimals, String? name, String? symbol, + ExtrisincStatus? extrisincStatus, + int? blockNumber, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAssetHistorySetMetadata.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAssetHistorySetMetadata.copyWith.fieldName(...)` class _$AssetHistorySetMetadataCWProxyImpl implements _$AssetHistorySetMetadataCWProxy { - final AssetHistorySetMetadata _value; - const _$AssetHistorySetMetadataCWProxyImpl(this._value); - @override - AssetHistorySetMetadata authorAddress(String authorAddress) => - this(authorAddress: authorAddress); + final AssetHistorySetMetadata _value; @override AssetHistorySetMetadata blockDatetime(DateTime blockDatetime) => this(blockDatetime: blockDatetime); @override - AssetHistorySetMetadata blockNumber(int blockNumber) => - this(blockNumber: blockNumber); + AssetHistorySetMetadata extrinsicIdx(int extrinsicIdx) => + this(extrinsicIdx: extrinsicIdx); + + @override + AssetHistorySetMetadata authorAddress(String authorAddress) => + this(authorAddress: authorAddress); @override AssetHistorySetMetadata decimals(String decimals) => this(decimals: decimals); @override - AssetHistorySetMetadata extrinsicIdx(int extrinsicIdx) => - this(extrinsicIdx: extrinsicIdx); + AssetHistorySetMetadata name(String name) => this(name: name); @override - AssetHistorySetMetadata extrisincStatus(ExtrisincStatus extrisincStatus) => - this(extrisincStatus: extrisincStatus); + AssetHistorySetMetadata symbol(String symbol) => this(symbol: symbol); @override - AssetHistorySetMetadata name(String name) => this(name: name); + AssetHistorySetMetadata extrisincStatus(ExtrisincStatus extrisincStatus) => + this(extrisincStatus: extrisincStatus); @override - AssetHistorySetMetadata symbol(String symbol) => this(symbol: symbol); + AssetHistorySetMetadata blockNumber(int blockNumber) => + this(blockNumber: blockNumber); @override @@ -86,45 +86,35 @@ class _$AssetHistorySetMetadataCWProxyImpl /// AssetHistorySetMetadata(...).copyWith(id: 12, name: "My name") /// ```` AssetHistorySetMetadata call({ - Object? authorAddress = const $CopyWithPlaceholder(), Object? blockDatetime = const $CopyWithPlaceholder(), - Object? blockNumber = const $CopyWithPlaceholder(), - Object? decimals = const $CopyWithPlaceholder(), Object? extrinsicIdx = const $CopyWithPlaceholder(), - Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? authorAddress = const $CopyWithPlaceholder(), + Object? decimals = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), Object? symbol = const $CopyWithPlaceholder(), + Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? blockNumber = const $CopyWithPlaceholder(), }) { return AssetHistorySetMetadata( - authorAddress: - authorAddress == const $CopyWithPlaceholder() || authorAddress == null - ? _value.authorAddress - // ignore: cast_nullable_to_non_nullable - : authorAddress as String, blockDatetime: blockDatetime == const $CopyWithPlaceholder() || blockDatetime == null ? _value.blockDatetime // ignore: cast_nullable_to_non_nullable : blockDatetime as DateTime, - blockNumber: - blockNumber == const $CopyWithPlaceholder() || blockNumber == null - ? _value.blockNumber - // ignore: cast_nullable_to_non_nullable - : blockNumber as int, - decimals: decimals == const $CopyWithPlaceholder() || decimals == null - ? _value.decimals - // ignore: cast_nullable_to_non_nullable - : decimals as String, extrinsicIdx: extrinsicIdx == const $CopyWithPlaceholder() || extrinsicIdx == null ? _value.extrinsicIdx // ignore: cast_nullable_to_non_nullable : extrinsicIdx as int, - extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || - extrisincStatus == null - ? _value.extrisincStatus + authorAddress: + authorAddress == const $CopyWithPlaceholder() || authorAddress == null + ? _value.authorAddress + // ignore: cast_nullable_to_non_nullable + : authorAddress as String, + decimals: decimals == const $CopyWithPlaceholder() || decimals == null + ? _value.decimals // ignore: cast_nullable_to_non_nullable - : extrisincStatus as ExtrisincStatus, + : decimals as String, name: name == const $CopyWithPlaceholder() || name == null ? _value.name // ignore: cast_nullable_to_non_nullable @@ -133,6 +123,16 @@ class _$AssetHistorySetMetadataCWProxyImpl ? _value.symbol // ignore: cast_nullable_to_non_nullable : symbol as String, + extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || + extrisincStatus == null + ? _value.extrisincStatus + // ignore: cast_nullable_to_non_nullable + : extrisincStatus as ExtrisincStatus, + blockNumber: + blockNumber == const $CopyWithPlaceholder() || blockNumber == null + ? _value.blockNumber + // ignore: cast_nullable_to_non_nullable + : blockNumber as int, ); } } diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart index 2649ed61..e4bed4b6 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart @@ -7,25 +7,25 @@ part of 'asset_history_transfer.dart'; // ************************************************************************** abstract class _$AssetHistoryTransferCWProxy { - AssetHistoryTransfer authorAddress(String authorAddress); - AssetHistoryTransfer blockDatetime(DateTime blockDatetime); - AssetHistoryTransfer blockNumber(int blockNumber); + AssetHistoryTransfer extrinsicIdx(int extrinsicIdx); - AssetHistoryTransfer decimals(int decimals); + AssetHistoryTransfer authorAddress(String authorAddress); - AssetHistoryTransfer extrinsicIdx(int extrinsicIdx); + AssetHistoryTransfer value(String value); - AssetHistoryTransfer extrisincStatus(ExtrisincStatus extrisincStatus); + AssetHistoryTransfer targetAddress(String targetAddress); AssetHistoryTransfer isFrom(bool isFrom); AssetHistoryTransfer symbols(String symbols); - AssetHistoryTransfer targetAddress(String targetAddress); + AssetHistoryTransfer decimals(int decimals); - AssetHistoryTransfer value(String value); + AssetHistoryTransfer extrisincStatus(ExtrisincStatus extrisincStatus); + + AssetHistoryTransfer blockNumber(int blockNumber); /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistoryTransfer(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// @@ -34,48 +34,44 @@ abstract class _$AssetHistoryTransferCWProxy { /// AssetHistoryTransfer(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryTransfer call({ - String? authorAddress, DateTime? blockDatetime, - int? blockNumber, - int? decimals, int? extrinsicIdx, - ExtrisincStatus? extrisincStatus, + String? authorAddress, + String? value, + String? targetAddress, bool? isFrom, String? symbols, - String? targetAddress, - String? value, + int? decimals, + ExtrisincStatus? extrisincStatus, + int? blockNumber, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAssetHistoryTransfer.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAssetHistoryTransfer.copyWith.fieldName(...)` class _$AssetHistoryTransferCWProxyImpl implements _$AssetHistoryTransferCWProxy { - final AssetHistoryTransfer _value; - const _$AssetHistoryTransferCWProxyImpl(this._value); - @override - AssetHistoryTransfer authorAddress(String authorAddress) => - this(authorAddress: authorAddress); + final AssetHistoryTransfer _value; @override AssetHistoryTransfer blockDatetime(DateTime blockDatetime) => this(blockDatetime: blockDatetime); @override - AssetHistoryTransfer blockNumber(int blockNumber) => - this(blockNumber: blockNumber); + AssetHistoryTransfer extrinsicIdx(int extrinsicIdx) => + this(extrinsicIdx: extrinsicIdx); @override - AssetHistoryTransfer decimals(int decimals) => this(decimals: decimals); + AssetHistoryTransfer authorAddress(String authorAddress) => + this(authorAddress: authorAddress); @override - AssetHistoryTransfer extrinsicIdx(int extrinsicIdx) => - this(extrinsicIdx: extrinsicIdx); + AssetHistoryTransfer value(String value) => this(value: value); @override - AssetHistoryTransfer extrisincStatus(ExtrisincStatus extrisincStatus) => - this(extrisincStatus: extrisincStatus); + AssetHistoryTransfer targetAddress(String targetAddress) => + this(targetAddress: targetAddress); @override AssetHistoryTransfer isFrom(bool isFrom) => this(isFrom: isFrom); @@ -84,11 +80,15 @@ class _$AssetHistoryTransferCWProxyImpl AssetHistoryTransfer symbols(String symbols) => this(symbols: symbols); @override - AssetHistoryTransfer targetAddress(String targetAddress) => - this(targetAddress: targetAddress); + AssetHistoryTransfer decimals(int decimals) => this(decimals: decimals); @override - AssetHistoryTransfer value(String value) => this(value: value); + AssetHistoryTransfer extrisincStatus(ExtrisincStatus extrisincStatus) => + this(extrisincStatus: extrisincStatus); + + @override + AssetHistoryTransfer blockNumber(int blockNumber) => + this(blockNumber: blockNumber); @override @@ -99,47 +99,42 @@ class _$AssetHistoryTransferCWProxyImpl /// AssetHistoryTransfer(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryTransfer call({ - Object? authorAddress = const $CopyWithPlaceholder(), Object? blockDatetime = const $CopyWithPlaceholder(), - Object? blockNumber = const $CopyWithPlaceholder(), - Object? decimals = const $CopyWithPlaceholder(), Object? extrinsicIdx = const $CopyWithPlaceholder(), - Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? authorAddress = const $CopyWithPlaceholder(), + Object? value = const $CopyWithPlaceholder(), + Object? targetAddress = const $CopyWithPlaceholder(), Object? isFrom = const $CopyWithPlaceholder(), Object? symbols = const $CopyWithPlaceholder(), - Object? targetAddress = const $CopyWithPlaceholder(), - Object? value = const $CopyWithPlaceholder(), + Object? decimals = const $CopyWithPlaceholder(), + Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? blockNumber = const $CopyWithPlaceholder(), }) { return AssetHistoryTransfer( - authorAddress: - authorAddress == const $CopyWithPlaceholder() || authorAddress == null - ? _value.authorAddress - // ignore: cast_nullable_to_non_nullable - : authorAddress as String, blockDatetime: blockDatetime == const $CopyWithPlaceholder() || blockDatetime == null ? _value.blockDatetime // ignore: cast_nullable_to_non_nullable : blockDatetime as DateTime, - blockNumber: - blockNumber == const $CopyWithPlaceholder() || blockNumber == null - ? _value.blockNumber - // ignore: cast_nullable_to_non_nullable - : blockNumber as int, - decimals: decimals == const $CopyWithPlaceholder() || decimals == null - ? _value.decimals - // ignore: cast_nullable_to_non_nullable - : decimals as int, extrinsicIdx: extrinsicIdx == const $CopyWithPlaceholder() || extrinsicIdx == null ? _value.extrinsicIdx // ignore: cast_nullable_to_non_nullable : extrinsicIdx as int, - extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || - extrisincStatus == null - ? _value.extrisincStatus + authorAddress: + authorAddress == const $CopyWithPlaceholder() || authorAddress == null + ? _value.authorAddress + // ignore: cast_nullable_to_non_nullable + : authorAddress as String, + value: value == const $CopyWithPlaceholder() || value == null + ? _value.value // ignore: cast_nullable_to_non_nullable - : extrisincStatus as ExtrisincStatus, + : value as String, + targetAddress: + targetAddress == const $CopyWithPlaceholder() || targetAddress == null + ? _value.targetAddress + // ignore: cast_nullable_to_non_nullable + : targetAddress as String, isFrom: isFrom == const $CopyWithPlaceholder() || isFrom == null ? _value.isFrom // ignore: cast_nullable_to_non_nullable @@ -148,15 +143,20 @@ class _$AssetHistoryTransferCWProxyImpl ? _value.symbols // ignore: cast_nullable_to_non_nullable : symbols as String, - targetAddress: - targetAddress == const $CopyWithPlaceholder() || targetAddress == null - ? _value.targetAddress - // ignore: cast_nullable_to_non_nullable - : targetAddress as String, - value: value == const $CopyWithPlaceholder() || value == null - ? _value.value + decimals: decimals == const $CopyWithPlaceholder() || decimals == null + ? _value.decimals // ignore: cast_nullable_to_non_nullable - : value as String, + : decimals as int, + extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || + extrisincStatus == null + ? _value.extrisincStatus + // ignore: cast_nullable_to_non_nullable + : extrisincStatus as ExtrisincStatus, + blockNumber: + blockNumber == const $CopyWithPlaceholder() || blockNumber == null + ? _value.blockNumber + // ignore: cast_nullable_to_non_nullable + : blockNumber as int, ); } } diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart index 25fc436c..383d308f 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart @@ -7,20 +7,20 @@ part of 'asset_history_unknown.dart'; // ************************************************************************** abstract class _$AssetHistoryUnkownCWProxy { - AssetHistoryUnkown arguments(String arguments); + AssetHistoryUnkown blockDatetime(DateTime blockDatetime); - AssetHistoryUnkown authorAddress(String authorAddress); + AssetHistoryUnkown extrinsicIdx(int extrinsicIdx); - AssetHistoryUnkown blockDatetime(DateTime blockDatetime); + AssetHistoryUnkown authorAddress(String authorAddress); - AssetHistoryUnkown blockNumber(int blockNumber); + AssetHistoryUnkown arguments(String arguments); AssetHistoryUnkown callModule(String callModule); - AssetHistoryUnkown extrinsicIdx(int extrinsicIdx); - AssetHistoryUnkown extrisincStatus(ExtrisincStatus extrisincStatus); + AssetHistoryUnkown blockNumber(int blockNumber); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistoryUnkown(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -28,49 +28,49 @@ abstract class _$AssetHistoryUnkownCWProxy { /// AssetHistoryUnkown(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryUnkown call({ - String? arguments, - String? authorAddress, DateTime? blockDatetime, - int? blockNumber, - String? callModule, int? extrinsicIdx, + String? authorAddress, + String? arguments, + String? callModule, ExtrisincStatus? extrisincStatus, + int? blockNumber, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAssetHistoryUnkown.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAssetHistoryUnkown.copyWith.fieldName(...)` class _$AssetHistoryUnkownCWProxyImpl implements _$AssetHistoryUnkownCWProxy { + const _$AssetHistoryUnkownCWProxyImpl(this._value); + final AssetHistoryUnkown _value; - const _$AssetHistoryUnkownCWProxyImpl(this._value); + @override + AssetHistoryUnkown blockDatetime(DateTime blockDatetime) => + this(blockDatetime: blockDatetime); @override - AssetHistoryUnkown arguments(String arguments) => this(arguments: arguments); + AssetHistoryUnkown extrinsicIdx(int extrinsicIdx) => + this(extrinsicIdx: extrinsicIdx); @override AssetHistoryUnkown authorAddress(String authorAddress) => this(authorAddress: authorAddress); @override - AssetHistoryUnkown blockDatetime(DateTime blockDatetime) => - this(blockDatetime: blockDatetime); - - @override - AssetHistoryUnkown blockNumber(int blockNumber) => - this(blockNumber: blockNumber); + AssetHistoryUnkown arguments(String arguments) => this(arguments: arguments); @override AssetHistoryUnkown callModule(String callModule) => this(callModule: callModule); - @override - AssetHistoryUnkown extrinsicIdx(int extrinsicIdx) => - this(extrinsicIdx: extrinsicIdx); - @override AssetHistoryUnkown extrisincStatus(ExtrisincStatus extrisincStatus) => this(extrisincStatus: extrisincStatus); + @override + AssetHistoryUnkown blockNumber(int blockNumber) => + this(blockNumber: blockNumber); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AssetHistoryUnkown(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -80,49 +80,49 @@ class _$AssetHistoryUnkownCWProxyImpl implements _$AssetHistoryUnkownCWProxy { /// AssetHistoryUnkown(...).copyWith(id: 12, name: "My name") /// ```` AssetHistoryUnkown call({ - Object? arguments = const $CopyWithPlaceholder(), - Object? authorAddress = const $CopyWithPlaceholder(), Object? blockDatetime = const $CopyWithPlaceholder(), - Object? blockNumber = const $CopyWithPlaceholder(), - Object? callModule = const $CopyWithPlaceholder(), Object? extrinsicIdx = const $CopyWithPlaceholder(), + Object? authorAddress = const $CopyWithPlaceholder(), + Object? arguments = const $CopyWithPlaceholder(), + Object? callModule = const $CopyWithPlaceholder(), Object? extrisincStatus = const $CopyWithPlaceholder(), + Object? blockNumber = const $CopyWithPlaceholder(), }) { return AssetHistoryUnkown( - arguments: arguments == const $CopyWithPlaceholder() || arguments == null - ? _value.arguments - // ignore: cast_nullable_to_non_nullable - : arguments as String, - authorAddress: - authorAddress == const $CopyWithPlaceholder() || authorAddress == null - ? _value.authorAddress - // ignore: cast_nullable_to_non_nullable - : authorAddress as String, blockDatetime: blockDatetime == const $CopyWithPlaceholder() || blockDatetime == null ? _value.blockDatetime // ignore: cast_nullable_to_non_nullable : blockDatetime as DateTime, - blockNumber: - blockNumber == const $CopyWithPlaceholder() || blockNumber == null - ? _value.blockNumber + extrinsicIdx: + extrinsicIdx == const $CopyWithPlaceholder() || extrinsicIdx == null + ? _value.extrinsicIdx // ignore: cast_nullable_to_non_nullable - : blockNumber as int, + : extrinsicIdx as int, + authorAddress: + authorAddress == const $CopyWithPlaceholder() || authorAddress == null + ? _value.authorAddress + // ignore: cast_nullable_to_non_nullable + : authorAddress as String, + arguments: arguments == const $CopyWithPlaceholder() || arguments == null + ? _value.arguments + // ignore: cast_nullable_to_non_nullable + : arguments as String, callModule: callModule == const $CopyWithPlaceholder() || callModule == null ? _value.callModule // ignore: cast_nullable_to_non_nullable : callModule as String, - extrinsicIdx: - extrinsicIdx == const $CopyWithPlaceholder() || extrinsicIdx == null - ? _value.extrinsicIdx - // ignore: cast_nullable_to_non_nullable - : extrinsicIdx as int, extrisincStatus: extrisincStatus == const $CopyWithPlaceholder() || extrisincStatus == null ? _value.extrisincStatus // ignore: cast_nullable_to_non_nullable : extrisincStatus as ExtrisincStatus, + blockNumber: + blockNumber == const $CopyWithPlaceholder() || blockNumber == null + ? _value.blockNumber + // ignore: cast_nullable_to_non_nullable + : blockNumber as int, ); } } diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart index 38a6d17d..ffcdb328 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart @@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart'; import 'package:threedpass/core/widgets/buttons/elevated_button.dart'; import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart'; import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart'; @@ -13,11 +14,13 @@ class AssetTransferButton extends StatelessWidget { void onPressed(final BuildContext context) { final tkd = BlocProvider.of(context).tokenBalanceData; + final appService = BlocProvider.of(context).state; context.router.push( TransferRouteWrapper( metadata: AssetTransferMetaDTO( tokenBalanceData: tkd, + appService: appService, ), ), ); diff --git a/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart b/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart index c7dc4642..781968ab 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/transfer_page.dart @@ -11,8 +11,10 @@ import 'package:threedpass/core/utils/validators.dart'; import 'package:threedpass/core/widgets/buttons/elevated_button.dart'; import 'package:threedpass/core/widgets/d3p_scaffold.dart'; import 'package:threedpass/core/widgets/input/textformfield/textformfield.dart'; +import 'package:threedpass/core/widgets/paddings.dart'; import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart'; import 'package:threedpass/features/wallet_screen/bloc/transfer_info_cubit.dart'; +import 'package:threedpass/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart'; part './widgets/make_transfer_button.dart'; part 'widgets/from_address_textfield.dart'; @@ -52,20 +54,22 @@ class TransferPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox(height: 16), + const SizedBoxH16(), const _FromAddressTextField(), - const SizedBox(height: 24), + const SizedBoxH24(), _ToAddressTextField( toAddressController: toAddressController, ), - const SizedBox(height: 24), + const SizedBoxH24(), _AmountTextFieldBuilder( amountController: amountController, ), - const SizedBox(height: 24), + const SizedBoxH24(), _PasswordTextField( passwordController: passwordController, ), + const SizedBoxH24(), + const TransferTypeDropdown(), // const SizedBox(height: 24), // const _FeesText(), const SizedBox(height: 36), diff --git a/lib/features/wallet_screen/presentation/transfer_page/transfer_page_wrapper.dart b/lib/features/wallet_screen/presentation/transfer_page/transfer_page_wrapper.dart index 25893c4a..32a08f5c 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/transfer_page_wrapper.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/transfer_page_wrapper.dart @@ -18,7 +18,7 @@ class TransferPageWrapper extends StatelessWidget implements AutoRouteWrapper { @override Widget wrappedRoute(final BuildContext context) { final appService = BlocProvider.of(context).state; - final balance = metadata.getBalance(appService); + final balance = metadata.getBalance(); return MultiBlocProvider( providers: [ @@ -27,7 +27,8 @@ class TransferPageWrapper extends StatelessWidget implements AutoRouteWrapper { create: (final _) => TransferInfoCubit( balance: balance, metaDTO: metadata, - )..init(appService), + appService: appService, + )..init(), lazy: false, ), BlocProvider( diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/amount_textfield.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/amount_textfield.dart index 723f586b..76e66e77 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/widgets/amount_textfield.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/widgets/amount_textfield.dart @@ -19,6 +19,7 @@ class _AmountTextFieldBuilder extends StatelessWidget { } } +// TODO When input 0.2 it throws error class _AmountTextField extends StatelessWidget { const _AmountTextField({ required this.amountController, diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart index cfe17d4f..e4c16f8e 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/widgets/make_transfer_button.dart @@ -20,7 +20,6 @@ class _MakeTransferButton extends StatelessWidget { final transferInfoMeta = BlocProvider.of(context); await transferInfoMeta.sendTransfer( - appService: appService, toAddress: toAddressController.text, amount: amountController.text, password: passwordController.text, diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart new file mode 100644 index 00000000..a7abf46e --- /dev/null +++ b/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:threedpass/core/polkawallet/utils/transfer_type.dart'; +import 'package:threedpass/core/widgets/buttons/dropdown_button.dart'; +import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/features/wallet_screen/bloc/transfer_info_cubit.dart'; + +class TransferTypeDropdown extends StatelessWidget { + const TransferTypeDropdown({ + final Key? key, + }) : super(key: key); + + void onChanged(final BuildContext context, final TransferType? value) { + if (value != null) { + BlocProvider.of(context).updateTransferType(value); + } + } + + @override + Widget build(final BuildContext context) { + return BlocBuilder( + builder: (final context, final state) { + final items = TransferType.values + .map( + (final e) => DropdownMenuItem( + value: e, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: D3pBodyMediumText( + e.name, + translate: false, + ), + ), + ), + ) + .toList(); + final value = state.type; + + return D3pDropdownButton( + context: context, + items: items, + onChanged: (final TransferType? value) => onChanged(context, value), + value: value, + ); + }, + ); + } +} diff --git a/lib/router/router.gr.dart b/lib/router/router.gr.dart index b261df6b..189a25f9 100644 --- a/lib/router/router.gr.dart +++ b/lib/router/router.gr.dart @@ -14,25 +14,25 @@ import 'package:flutter/widgets.dart' as _i50; import 'package:threedpass/core/widgets/default_loading_dialog.dart' as _i2; import 'package:threedpass/core/widgets/error_page.dart' as _i1; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_credentials.dart' - as _i29; + as _i30; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_from_object/create_account_from_object.dart' - as _i24; + as _i25; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_info_page.dart' - as _i26; + as _i27; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_loader.dart' - as _i31; + as _i32; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_mnemonic_backup.dart' - as _i27; -import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_mnemonic_confirm.dart' as _i28; +import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_mnemonic_confirm.dart' + as _i29; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_type.dart' - as _i30; + as _i31; import 'package:threedpass/features/accounts/presentation/pages/create_account/create_account_wrapper.dart' - as _i23; + as _i24; import 'package:threedpass/features/accounts/presentation/pages/create_account/import_mnemonic_form.dart' - as _i25; + as _i26; import 'package:threedpass/features/accounts/presentation/pages/no_stable_hash_dialog.dart' - as _i32; + as _i33; import 'package:threedpass/features/compare_page/presentation/pages/compare_page_wrapper.dart' as _i3; import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart' @@ -44,7 +44,7 @@ import 'package:threedpass/features/home_page/presentation/home_page.dart' import 'package:threedpass/features/home_page/presentation/login_page.dart' as _i13; import 'package:threedpass/features/home_page/router/empty_initial_route.dart' - as _i36; + as _i15; import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart' as _i47; import 'package:threedpass/features/preview_page/presentation/preview_page.dart' @@ -68,43 +68,43 @@ import 'package:threedpass/features/scan_page/presentation/widgets/calc_hash_loa import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart' as _i51; import 'package:threedpass/features/settings_page/presentation/settings_page.dart' - as _i33; + as _i34; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/choose_algorithm_subpage.dart' - as _i39; -import 'package:threedpass/features/settings_page/presentation/settings_sub_page/grid_size_subpage.dart' as _i40; +import 'package:threedpass/features/settings_page/presentation/settings_sub_page/grid_size_subpage.dart' + as _i37; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/pixel_ratio_subpage.dart' as _i38; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/sections_subpage.dart' - as _i41; + as _i35; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/stable_hash_subpage.dart' - as _i34; + as _i41; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/trans_bytes_subpage.dart' - as _i42; + as _i36; import 'package:threedpass/features/settings_page/presentation/settings_sub_page/wallet_node_subpage.dart' - as _i37; + as _i39; import 'package:threedpass/features/settings_page/router/empty_settings_route.dart' - as _i35; + as _i42; import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart' as _i48; import 'package:threedpass/features/wallet_screen/presentation/assets_page/remove_account_dialog.dart' - as _i15; + as _i16; import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart' as _i49; import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_wrapper.dart' - as _i21; + as _i22; import 'package:threedpass/features/wallet_screen/presentation/recieve_page/recieve_page.dart' - as _i16; + as _i17; import 'package:threedpass/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_wrapper.dart' - as _i22; + as _i23; import 'package:threedpass/features/wallet_screen/presentation/transfer_page/transfer_page.dart' - as _i20; + as _i21; import 'package:threedpass/features/wallet_screen/presentation/transfer_page/transfer_page_wrapper.dart' - as _i19; + as _i20; import 'package:threedpass/features/wallet_screen/presentation/wallet_page/wallet_page.dart' - as _i17; -import 'package:threedpass/features/wallet_screen/presentation/wallet_page/wallet_page_wrapper.dart' as _i18; +import 'package:threedpass/features/wallet_screen/presentation/wallet_page/wallet_page_wrapper.dart' + as _i19; abstract class $RootRouter extends _i43.RootStackRouter { $RootRouter({super.navigatorKey}); @@ -239,28 +239,34 @@ abstract class $RootRouter extends _i43.RootStackRouter { child: const _i14.HomePage(), ); }, + InitialWrapperRoute.name: (routeData) { + return _i43.AutoRoutePage( + routeData: routeData, + child: const _i15.EmptyInitialRoute(), + ); + }, RemoveAccountRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i15.RemoveAccountDialog(), + child: const _i16.RemoveAccountDialog(), ); }, RecieveRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i16.RecievePage(), + child: const _i17.RecievePage(), ); }, WalletRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i17.WalletPage(), + child: const _i18.WalletPage(), ); }, WalletRouteWrapper.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: _i43.WrappedRoute(child: const _i18.WalletPageWrapper()), + child: _i43.WrappedRoute(child: const _i19.WalletPageWrapper()), ); }, TransferRouteWrapper.name: (routeData) { @@ -268,7 +274,7 @@ abstract class $RootRouter extends _i43.RootStackRouter { return _i43.AutoRoutePage( routeData: routeData, child: _i43.WrappedRoute( - child: _i19.TransferPageWrapper( + child: _i20.TransferPageWrapper( metadata: args.metadata, key: args.key, )), @@ -279,14 +285,14 @@ abstract class $RootRouter extends _i43.RootStackRouter { orElse: () => const TransferRouteArgs()); return _i43.AutoRoutePage( routeData: routeData, - child: _i20.TransferPage(key: args.key), + child: _i21.TransferPage(key: args.key), ); }, NonNativeTokenRouteWrapper.name: (routeData) { final args = routeData.argsAs(); return _i43.AutoRoutePage( routeData: routeData, - child: _i21.NonNativeTokenPageWrapper( + child: _i22.NonNativeTokenPageWrapper( args.params, key: args.key, ), @@ -295,19 +301,19 @@ abstract class $RootRouter extends _i43.RootStackRouter { TransactionsHistoryRouteWrapper.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i22.TransactionsHistoryPageWrapper(), + child: const _i23.TransactionsHistoryPageWrapper(), ); }, CreateAccountRouteWrapper.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: _i43.WrappedRoute(child: const _i23.CreateAccountPageWrapper()), + child: _i43.WrappedRoute(child: const _i24.CreateAccountPageWrapper()), ); }, CreateAccountFromObjectRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i24.CreateAccountFromObjectPage(), + child: const _i25.CreateAccountFromObjectPage(), ); }, ImportMnemonicFormRoute.name: (routeData) { @@ -315,32 +321,32 @@ abstract class $RootRouter extends _i43.RootStackRouter { orElse: () => const ImportMnemonicFormRouteArgs()); return _i43.AutoRoutePage( routeData: routeData, - child: _i25.ImportMnemonicFormPage(key: args.key), + child: _i26.ImportMnemonicFormPage(key: args.key), ); }, CreateAccountInfoRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i26.CreateAccountInfoPage(), + child: const _i27.CreateAccountInfoPage(), ); }, CreateAccountMnemonicBackupRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i27.CreateAccountMnemonicBackupPage(), + child: const _i28.CreateAccountMnemonicBackupPage(), ); }, CreateAccountMnemonicConfirmRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i28.CreateAccountMnemonicConfirmPage(), + child: const _i29.CreateAccountMnemonicConfirmPage(), ); }, CreateAccountCredentialsRoute.name: (routeData) { final args = routeData.argsAs(); return _i43.AutoRoutePage( routeData: routeData, - child: _i29.CreateAccountCredentialsPage( + child: _i30.CreateAccountCredentialsPage( appbarText: args.appbarText, key: args.key, ), @@ -349,57 +355,51 @@ abstract class $RootRouter extends _i43.RootStackRouter { CreateAccountTypeRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i30.CreateAccountTypePage(), + child: const _i31.CreateAccountTypePage(), ); }, CreateAccountLoaderRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i31.CreateAccountLoaderPage(), + child: const _i32.CreateAccountLoaderPage(), ); }, NoStableHashRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i32.NoStableHashDialog(), + child: const _i33.NoStableHashDialog(), ); }, SettingsRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i33.SettingsPage(), + child: const _i34.SettingsPage(), ); }, - StableHashSubRoute.name: (routeData) { - final args = routeData.argsAs(); + SectionsSubRoute.name: (routeData) { + final args = routeData.argsAs(); return _i43.AutoRoutePage( routeData: routeData, - child: _i34.StableHashSubPage( + child: _i35.SectionsSubPage( initialState: args.initialState, key: args.key, ), ); }, - SettingsWrapperRoute.name: (routeData) { - return _i43.AutoRoutePage( - routeData: routeData, - child: const _i35.EmptySettingsRoute(), - ); - }, - InitialWrapperRoute.name: (routeData) { + TransBytesSubRoute.name: (routeData) { + final args = routeData.argsAs(); return _i43.AutoRoutePage( routeData: routeData, - child: const _i36.EmptyInitialRoute(), + child: _i36.TransBytesSubPage( + initialState: args.initialState, + key: args.key, + ), ); }, - WalletNodeSubRoute.name: (routeData) { - final args = routeData.argsAs(); + GridSizeSubRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: _i37.WalletNodeSubPage( - initialState: args.initialState, - key: args.key, - ), + child: const _i37.GridSizeSubPage(), ); }, PixelRatioSubRoute.name: (routeData) { @@ -408,36 +408,36 @@ abstract class $RootRouter extends _i43.RootStackRouter { child: const _i38.PixelRatioSubPage(), ); }, - ChooseAlgorithmSubRoute.name: (routeData) { + WalletNodeSubRoute.name: (routeData) { + final args = routeData.argsAs(); return _i43.AutoRoutePage( routeData: routeData, - child: const _i39.ChooseAlgorithmSubPage(), + child: _i39.WalletNodeSubPage( + initialState: args.initialState, + key: args.key, + ), ); }, - GridSizeSubRoute.name: (routeData) { + ChooseAlgorithmSubRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: const _i40.GridSizeSubPage(), + child: const _i40.ChooseAlgorithmSubPage(), ); }, - SectionsSubRoute.name: (routeData) { - final args = routeData.argsAs(); + StableHashSubRoute.name: (routeData) { + final args = routeData.argsAs(); return _i43.AutoRoutePage( routeData: routeData, - child: _i41.SectionsSubPage( + child: _i41.StableHashSubPage( initialState: args.initialState, key: args.key, ), ); }, - TransBytesSubRoute.name: (routeData) { - final args = routeData.argsAs(); + SettingsWrapperRoute.name: (routeData) { return _i43.AutoRoutePage( routeData: routeData, - child: _i42.TransBytesSubPage( - initialState: args.initialState, - key: args.key, - ), + child: const _i42.EmptySettingsRoute(), ); }, }; @@ -881,7 +881,21 @@ class HomeRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i15.RemoveAccountDialog] +/// [_i15.EmptyInitialRoute] +class InitialWrapperRoute extends _i43.PageRouteInfo { + const InitialWrapperRoute({List<_i43.PageRouteInfo>? children}) + : super( + InitialWrapperRoute.name, + initialChildren: children, + ); + + static const String name = 'InitialWrapperRoute'; + + static const _i43.PageInfo page = _i43.PageInfo(name); +} + +/// generated route for +/// [_i16.RemoveAccountDialog] class RemoveAccountRoute extends _i43.PageRouteInfo { const RemoveAccountRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -895,7 +909,7 @@ class RemoveAccountRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i16.RecievePage] +/// [_i17.RecievePage] class RecieveRoute extends _i43.PageRouteInfo { const RecieveRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -909,7 +923,7 @@ class RecieveRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i17.WalletPage] +/// [_i18.WalletPage] class WalletRoute extends _i43.PageRouteInfo { const WalletRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -923,7 +937,7 @@ class WalletRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i18.WalletPageWrapper] +/// [_i19.WalletPageWrapper] class WalletRouteWrapper extends _i43.PageRouteInfo { const WalletRouteWrapper({List<_i43.PageRouteInfo>? children}) : super( @@ -937,7 +951,7 @@ class WalletRouteWrapper extends _i43.PageRouteInfo { } /// generated route for -/// [_i19.TransferPageWrapper] +/// [_i20.TransferPageWrapper] class TransferRouteWrapper extends _i43.PageRouteInfo { TransferRouteWrapper({ @@ -976,7 +990,7 @@ class TransferRouteWrapperArgs { } /// generated route for -/// [_i20.TransferPage] +/// [_i21.TransferPage] class TransferRoute extends _i43.PageRouteInfo { TransferRoute({ _i44.Key? key, @@ -1005,7 +1019,7 @@ class TransferRouteArgs { } /// generated route for -/// [_i21.NonNativeTokenPageWrapper] +/// [_i22.NonNativeTokenPageWrapper] class NonNativeTokenRouteWrapper extends _i43.PageRouteInfo { NonNativeTokenRouteWrapper({ @@ -1044,7 +1058,7 @@ class NonNativeTokenRouteWrapperArgs { } /// generated route for -/// [_i22.TransactionsHistoryPageWrapper] +/// [_i23.TransactionsHistoryPageWrapper] class TransactionsHistoryRouteWrapper extends _i43.PageRouteInfo { const TransactionsHistoryRouteWrapper({List<_i43.PageRouteInfo>? children}) : super( @@ -1058,7 +1072,7 @@ class TransactionsHistoryRouteWrapper extends _i43.PageRouteInfo { } /// generated route for -/// [_i23.CreateAccountPageWrapper] +/// [_i24.CreateAccountPageWrapper] class CreateAccountRouteWrapper extends _i43.PageRouteInfo { const CreateAccountRouteWrapper({List<_i43.PageRouteInfo>? children}) : super( @@ -1072,7 +1086,7 @@ class CreateAccountRouteWrapper extends _i43.PageRouteInfo { } /// generated route for -/// [_i24.CreateAccountFromObjectPage] +/// [_i25.CreateAccountFromObjectPage] class CreateAccountFromObjectRoute extends _i43.PageRouteInfo { const CreateAccountFromObjectRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1086,7 +1100,7 @@ class CreateAccountFromObjectRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i25.ImportMnemonicFormPage] +/// [_i26.ImportMnemonicFormPage] class ImportMnemonicFormRoute extends _i43.PageRouteInfo { ImportMnemonicFormRoute({ @@ -1116,7 +1130,7 @@ class ImportMnemonicFormRouteArgs { } /// generated route for -/// [_i26.CreateAccountInfoPage] +/// [_i27.CreateAccountInfoPage] class CreateAccountInfoRoute extends _i43.PageRouteInfo { const CreateAccountInfoRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1130,7 +1144,7 @@ class CreateAccountInfoRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i27.CreateAccountMnemonicBackupPage] +/// [_i28.CreateAccountMnemonicBackupPage] class CreateAccountMnemonicBackupRoute extends _i43.PageRouteInfo { const CreateAccountMnemonicBackupRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1144,7 +1158,7 @@ class CreateAccountMnemonicBackupRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i28.CreateAccountMnemonicConfirmPage] +/// [_i29.CreateAccountMnemonicConfirmPage] class CreateAccountMnemonicConfirmRoute extends _i43.PageRouteInfo { const CreateAccountMnemonicConfirmRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1158,7 +1172,7 @@ class CreateAccountMnemonicConfirmRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i29.CreateAccountCredentialsPage] +/// [_i30.CreateAccountCredentialsPage] class CreateAccountCredentialsRoute extends _i43.PageRouteInfo { CreateAccountCredentialsRoute({ @@ -1197,7 +1211,7 @@ class CreateAccountCredentialsRouteArgs { } /// generated route for -/// [_i30.CreateAccountTypePage] +/// [_i31.CreateAccountTypePage] class CreateAccountTypeRoute extends _i43.PageRouteInfo { const CreateAccountTypeRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1211,7 +1225,7 @@ class CreateAccountTypeRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i31.CreateAccountLoaderPage] +/// [_i32.CreateAccountLoaderPage] class CreateAccountLoaderRoute extends _i43.PageRouteInfo { const CreateAccountLoaderRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1225,7 +1239,7 @@ class CreateAccountLoaderRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i32.NoStableHashDialog] +/// [_i33.NoStableHashDialog] class NoStableHashRoute extends _i43.PageRouteInfo { const NoStableHashRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1239,7 +1253,7 @@ class NoStableHashRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i33.SettingsPage] +/// [_i34.SettingsPage] class SettingsRoute extends _i43.PageRouteInfo { const SettingsRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1253,29 +1267,29 @@ class SettingsRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i34.StableHashSubPage] -class StableHashSubRoute extends _i43.PageRouteInfo { - StableHashSubRoute({ +/// [_i35.SectionsSubPage] +class SectionsSubRoute extends _i43.PageRouteInfo { + SectionsSubRoute({ required _i51.GlobalSettings initialState, _i44.Key? key, List<_i43.PageRouteInfo>? children, }) : super( - StableHashSubRoute.name, - args: StableHashSubRouteArgs( + SectionsSubRoute.name, + args: SectionsSubRouteArgs( initialState: initialState, key: key, ), initialChildren: children, ); - static const String name = 'StableHashSubRoute'; + static const String name = 'SectionsSubRoute'; - static const _i43.PageInfo page = - _i43.PageInfo(name); + static const _i43.PageInfo page = + _i43.PageInfo(name); } -class StableHashSubRouteArgs { - const StableHashSubRouteArgs({ +class SectionsSubRouteArgs { + const SectionsSubRouteArgs({ required this.initialState, this.key, }); @@ -1286,40 +1300,78 @@ class StableHashSubRouteArgs { @override String toString() { - return 'StableHashSubRouteArgs{initialState: $initialState, key: $key}'; + return 'SectionsSubRouteArgs{initialState: $initialState, key: $key}'; } } /// generated route for -/// [_i35.EmptySettingsRoute] -class SettingsWrapperRoute extends _i43.PageRouteInfo { - const SettingsWrapperRoute({List<_i43.PageRouteInfo>? children}) +/// [_i36.TransBytesSubPage] +class TransBytesSubRoute extends _i43.PageRouteInfo { + TransBytesSubRoute({ + required _i51.GlobalSettings initialState, + _i44.Key? key, + List<_i43.PageRouteInfo>? children, + }) : super( + TransBytesSubRoute.name, + args: TransBytesSubRouteArgs( + initialState: initialState, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'TransBytesSubRoute'; + + static const _i43.PageInfo page = + _i43.PageInfo(name); +} + +class TransBytesSubRouteArgs { + const TransBytesSubRouteArgs({ + required this.initialState, + this.key, + }); + + final _i51.GlobalSettings initialState; + + final _i44.Key? key; + + @override + String toString() { + return 'TransBytesSubRouteArgs{initialState: $initialState, key: $key}'; + } +} + +/// generated route for +/// [_i37.GridSizeSubPage] +class GridSizeSubRoute extends _i43.PageRouteInfo { + const GridSizeSubRoute({List<_i43.PageRouteInfo>? children}) : super( - SettingsWrapperRoute.name, + GridSizeSubRoute.name, initialChildren: children, ); - static const String name = 'SettingsWrapperRoute'; + static const String name = 'GridSizeSubRoute'; static const _i43.PageInfo page = _i43.PageInfo(name); } /// generated route for -/// [_i36.EmptyInitialRoute] -class InitialWrapperRoute extends _i43.PageRouteInfo { - const InitialWrapperRoute({List<_i43.PageRouteInfo>? children}) +/// [_i38.PixelRatioSubPage] +class PixelRatioSubRoute extends _i43.PageRouteInfo { + const PixelRatioSubRoute({List<_i43.PageRouteInfo>? children}) : super( - InitialWrapperRoute.name, + PixelRatioSubRoute.name, initialChildren: children, ); - static const String name = 'InitialWrapperRoute'; + static const String name = 'PixelRatioSubRoute'; static const _i43.PageInfo page = _i43.PageInfo(name); } /// generated route for -/// [_i37.WalletNodeSubPage] +/// [_i39.WalletNodeSubPage] class WalletNodeSubRoute extends _i43.PageRouteInfo { WalletNodeSubRoute({ required _i51.GlobalSettings initialState, @@ -1357,21 +1409,7 @@ class WalletNodeSubRouteArgs { } /// generated route for -/// [_i38.PixelRatioSubPage] -class PixelRatioSubRoute extends _i43.PageRouteInfo { - const PixelRatioSubRoute({List<_i43.PageRouteInfo>? children}) - : super( - PixelRatioSubRoute.name, - initialChildren: children, - ); - - static const String name = 'PixelRatioSubRoute'; - - static const _i43.PageInfo page = _i43.PageInfo(name); -} - -/// generated route for -/// [_i39.ChooseAlgorithmSubPage] +/// [_i40.ChooseAlgorithmSubPage] class ChooseAlgorithmSubRoute extends _i43.PageRouteInfo { const ChooseAlgorithmSubRoute({List<_i43.PageRouteInfo>? children}) : super( @@ -1385,43 +1423,29 @@ class ChooseAlgorithmSubRoute extends _i43.PageRouteInfo { } /// generated route for -/// [_i40.GridSizeSubPage] -class GridSizeSubRoute extends _i43.PageRouteInfo { - const GridSizeSubRoute({List<_i43.PageRouteInfo>? children}) - : super( - GridSizeSubRoute.name, - initialChildren: children, - ); - - static const String name = 'GridSizeSubRoute'; - - static const _i43.PageInfo page = _i43.PageInfo(name); -} - -/// generated route for -/// [_i41.SectionsSubPage] -class SectionsSubRoute extends _i43.PageRouteInfo { - SectionsSubRoute({ +/// [_i41.StableHashSubPage] +class StableHashSubRoute extends _i43.PageRouteInfo { + StableHashSubRoute({ required _i51.GlobalSettings initialState, _i44.Key? key, List<_i43.PageRouteInfo>? children, }) : super( - SectionsSubRoute.name, - args: SectionsSubRouteArgs( + StableHashSubRoute.name, + args: StableHashSubRouteArgs( initialState: initialState, key: key, ), initialChildren: children, ); - static const String name = 'SectionsSubRoute'; + static const String name = 'StableHashSubRoute'; - static const _i43.PageInfo page = - _i43.PageInfo(name); + static const _i43.PageInfo page = + _i43.PageInfo(name); } -class SectionsSubRouteArgs { - const SectionsSubRouteArgs({ +class StableHashSubRouteArgs { + const StableHashSubRouteArgs({ required this.initialState, this.key, }); @@ -1432,44 +1456,20 @@ class SectionsSubRouteArgs { @override String toString() { - return 'SectionsSubRouteArgs{initialState: $initialState, key: $key}'; + return 'StableHashSubRouteArgs{initialState: $initialState, key: $key}'; } } /// generated route for -/// [_i42.TransBytesSubPage] -class TransBytesSubRoute extends _i43.PageRouteInfo { - TransBytesSubRoute({ - required _i51.GlobalSettings initialState, - _i44.Key? key, - List<_i43.PageRouteInfo>? children, - }) : super( - TransBytesSubRoute.name, - args: TransBytesSubRouteArgs( - initialState: initialState, - key: key, - ), +/// [_i42.EmptySettingsRoute] +class SettingsWrapperRoute extends _i43.PageRouteInfo { + const SettingsWrapperRoute({List<_i43.PageRouteInfo>? children}) + : super( + SettingsWrapperRoute.name, initialChildren: children, ); - static const String name = 'TransBytesSubRoute'; - - static const _i43.PageInfo page = - _i43.PageInfo(name); -} - -class TransBytesSubRouteArgs { - const TransBytesSubRouteArgs({ - required this.initialState, - this.key, - }); - - final _i51.GlobalSettings initialState; - - final _i44.Key? key; + static const String name = 'SettingsWrapperRoute'; - @override - String toString() { - return 'TransBytesSubRouteArgs{initialState: $initialState, key: $key}'; - } + static const _i43.PageInfo page = _i43.PageInfo(name); } From 87081289cbc3eca906ecf8bfff4be782447c8d10 Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Thu, 10 Aug 2023 19:57:00 +0300 Subject: [PATCH 07/12] Boolean keep-alive flag --- assets/translations/en.json | 7 +++- lib/core/widgets/buttons/icon_button.dart | 5 +++ lib/core/widgets/input/switch_button.dart | 33 ++++++++++++--- .../bloc/assets_get_extrisincs_cubit.dart | 1 + .../widgets/transfer_type_dropdown.dart | 40 ++++++------------- 5 files changed, 53 insertions(+), 33 deletions(-) diff --git a/assets/translations/en.json b/assets/translations/en.json index 6bf83616..5ecc00cb 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -288,5 +288,10 @@ }, "screen_lock_title": "Enter PIN code", "screen_lock_title_set": "Set your PIN code", - "screen_lock_title_confirm": "Confirm your PIN code" + "screen_lock_title_confirm": "Confirm your PIN code", + + "@2.7.2":{ + }, + "choose_transfer_keep_alive": "Keep sender alive", + "transfer_keep_alive_help": "With the keep-alive option set, the account is protected against removal due to low balances." } \ No newline at end of file diff --git a/lib/core/widgets/buttons/icon_button.dart b/lib/core/widgets/buttons/icon_button.dart index a626f383..263d7218 100644 --- a/lib/core/widgets/buttons/icon_button.dart +++ b/lib/core/widgets/buttons/icon_button.dart @@ -6,27 +6,32 @@ class D3pIconButton extends StatelessWidget { required this.iconData, this.onPressed, this.iconColor, + this.size, super.key, }); const D3pIconButton.fake({ super.key, }) : iconData = Icons.abc, + size = null, iconColor = Colors.transparent, onPressed = null; final IconData iconData; final Color? iconColor; final void Function()? onPressed; + final double? size; @override Widget build(final BuildContext context) { return PlatformIconButton( icon: Icon( iconData, + size: size, color: iconColor, ), onPressed: onPressed, + material: (_, __) => MaterialIconButtonData(padding: EdgeInsets.zero), ); } } diff --git a/lib/core/widgets/input/switch_button.dart b/lib/core/widgets/input/switch_button.dart index 29a8d547..0deb6350 100644 --- a/lib/core/widgets/input/switch_button.dart +++ b/lib/core/widgets/input/switch_button.dart @@ -1,12 +1,15 @@ import 'package:flutter/material.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:threedpass/core/theme/d3p_special_styles.dart'; +import 'package:threedpass/core/widgets/buttons/icon_button.dart'; class D3pSwitchButton extends StatelessWidget { D3pSwitchButton({ required final bool initialValue, required this.onChanged, required this.text, + this.helpText, final Key? key, }) : switchValueNotifier = ValueNotifier(initialValue), super(key: key); @@ -14,6 +17,7 @@ class D3pSwitchButton extends StatelessWidget { final void Function(bool)? onChanged; final ValueNotifier switchValueNotifier; final String text; + final String? helpText; @override Widget build(final BuildContext context) { @@ -22,11 +26,22 @@ class D3pSwitchButton extends StatelessWidget { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - text, - style: onChanged != null - ? customStyles.switchButtonLabelEnabled - : customStyles.switchButtonLabelDisabled, + Row( + children: [ + Text( + text, + style: onChanged != null + ? customStyles.switchButtonLabelEnabled + : customStyles.switchButtonLabelDisabled, + ), + if (helpText != null) + D3pIconButton( + iconData: Icons.info_outline_rounded, + size: 20, + iconColor: Colors.blue, + onPressed: showHelp, + ), + ], ), ValueListenableBuilder( valueListenable: switchValueNotifier, @@ -45,4 +60,12 @@ class D3pSwitchButton extends StatelessWidget { ], ); } + + void showHelp() { + // TODO show dialog instead of toast + Fluttertoast.showToast( + msg: helpText ?? '', + toastLength: Toast.LENGTH_LONG, + ); + } } diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart index 4d029477..329f0260 100644 --- a/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart +++ b/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart @@ -14,6 +14,7 @@ import 'package:threedpass/features/wallet_screen/presentation/non_native_token_ import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart'; import 'package:threedpass/setup.dart'; +// TODO Maybe parse all extrinsics, not only account holder to get all incoming transactions class AssetsGetExtrinsicsCubit extends Cubit { AssetsGetExtrinsicsCubit({ required this.getExtrinsics, diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart index a7abf46e..58b0e9ca 100644 --- a/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart +++ b/lib/features/wallet_screen/presentation/transfer_page/widgets/transfer_type_dropdown.dart @@ -1,8 +1,8 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:threedpass/core/polkawallet/utils/transfer_type.dart'; -import 'package:threedpass/core/widgets/buttons/dropdown_button.dart'; -import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; +import 'package:threedpass/core/widgets/input/switch_button.dart'; import 'package:threedpass/features/wallet_screen/bloc/transfer_info_cubit.dart'; class TransferTypeDropdown extends StatelessWidget { @@ -18,31 +18,17 @@ class TransferTypeDropdown extends StatelessWidget { @override Widget build(final BuildContext context) { - return BlocBuilder( - builder: (final context, final state) { - final items = TransferType.values - .map( - (final e) => DropdownMenuItem( - value: e, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: D3pBodyMediumText( - e.name, - translate: false, - ), - ), - ), - ) - .toList(); - final value = state.type; - - return D3pDropdownButton( - context: context, - items: items, - onChanged: (final TransferType? value) => onChanged(context, value), - value: value, - ); - }, + final initialValue = + BlocProvider.of(context).state.type == + TransferType.transferKeepAlive; + return D3pSwitchButton( + initialValue: initialValue, + helpText: 'transfer_keep_alive_help'.tr(), + onChanged: (final value) => onChanged( + context, + value ? TransferType.transferKeepAlive : TransferType.transfer, + ), + text: 'choose_transfer_keep_alive'.tr(), ); } } From d9cfe8fbbc6db3da3ceb681094a675b039d3328d Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Sun, 13 Aug 2023 17:55:41 +0300 Subject: [PATCH 08/12] FIX: float values are allowed as transfer amount input --- android/app/src/main/AndroidManifest.xml | 1 + lib/core/polkawallet/utils/balance_utils.dart | 24 +++++++------- lib/core/widgets/buttons/icon_button.dart | 3 +- .../file_picker.dart | 4 +-- .../snapshot_create_from_file.dart | 19 ++++------- .../widgets/get_object_from_file_button.dart | 19 +++++++++-- .../bloc/transfer_info_cubit.dart | 33 +++++++++++-------- 7 files changed, 60 insertions(+), 43 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1c9d11a4..99615ae3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ android:label="@string/app_name" android:icon="@mipmap/app_icon2" android:usesCleartextTraffic="true" + android:requestLegacyExternalStorage="true" tools:replace="android:icon, android:label"> to static BigInt tokenInt(final String? value, final int decimals) { - if (value == null) { - return BigInt.zero; - } - double v = 0; + // if (value == null) { + // return BigInt.zero; + // } + // double v = 0; try { - if (value.contains(',') || value.contains('.')) { - v = NumberFormat(",##0.${"0" * decimals}").parse(value) as double; - } else { - v = double.parse(value); - } + final v = double.parse(value ?? ''); + return BigInt.from(v * pow(10, decimals)); + // if (double.tryParse(value) != null) { + // v = NumberFormat(",##0.${"0" * decimals}").parse(value).toDouble(); + // } else { + // v = double.parse(value); + // } } on Exception catch (err) { - getIt().e('BalanceUtils.tokenInt() error: ${err}'); + throw Exception('BalanceUtils.tokenInt() value: ${value} error: ${err}'); + // getIt().e(); // debugPrint(); } - return BigInt.from(v * pow(10, decimals)); } static String formattedTotal( diff --git a/lib/core/widgets/buttons/icon_button.dart b/lib/core/widgets/buttons/icon_button.dart index 263d7218..16467892 100644 --- a/lib/core/widgets/buttons/icon_button.dart +++ b/lib/core/widgets/buttons/icon_button.dart @@ -31,7 +31,8 @@ class D3pIconButton extends StatelessWidget { color: iconColor, ), onPressed: onPressed, - material: (_, __) => MaterialIconButtonData(padding: EdgeInsets.zero), + material: (final _, final __) => + MaterialIconButtonData(padding: EdgeInsets.zero), ); } } diff --git a/lib/features/hashes_list/domain/entities/snapshot_create_from_file/file_picker.dart b/lib/features/hashes_list/domain/entities/snapshot_create_from_file/file_picker.dart index ecdd6d5a..061e9c10 100644 --- a/lib/features/hashes_list/domain/entities/snapshot_create_from_file/file_picker.dart +++ b/lib/features/hashes_list/domain/entities/snapshot_create_from_file/file_picker.dart @@ -1,6 +1,6 @@ -part of './snapshot_create_from_file.dart'; +import 'package:file_picker/file_picker.dart'; -class _FilePicker { +class FilePickerShortCut { static const allowedExtentions = ['obj', 'stl']; /// Get and validate file diff --git a/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart b/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart index 67e1d256..74c890d0 100644 --- a/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart +++ b/lib/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart @@ -1,5 +1,4 @@ import 'package:calc/calc.dart'; -import 'package:file_picker/file_picker.dart'; import 'package:logger/logger.dart'; import 'package:threedpass/core/utils/formatters.dart'; import 'package:threedpass/core/utils/hash_file.dart'; @@ -7,22 +6,19 @@ import 'package:threedpass/core/utils/pair.dart'; import 'package:threedpass/core/utils/random_hex.dart'; import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; -import 'package:threedpass/features/hashes_list/domain/entities/objects_directory.dart'; import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; -import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/file_copy.dart'; import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; import 'package:threedpass/features/settings_page/domain/entities/algorithm.dart'; import 'package:threedpass/features/settings_page/domain/entities/scan_settings.dart'; import 'package:threedpass/setup.dart'; -part './file_picker.dart'; part './trans_bytes.dart'; class SnapshotFileFactory { final ScanSettings scanSettings; final HashesListBloc hashesListBloc; final void Function() showLoader; - final ObjectsDirectory objectsDirectory; + // final ObjectsDirectory objectsDirectory; final ScanIsolateCubit scanIsolateCubit; // final void Function() hideLoader; @@ -30,7 +26,7 @@ class SnapshotFileFactory { required this.scanSettings, required this.hashesListBloc, required this.showLoader, - required this.objectsDirectory, + // required this.objectsDirectory, required this.scanIsolateCubit, // required this.hideLoader, }); @@ -39,13 +35,10 @@ class SnapshotFileFactory { return '$rawObjName ${Fmt.basicDateFormat.format(DateTime.now())}'; } - Future> createSnapshotFromFile() async { - final pickedFilePath = await _FilePicker().pickFile(); - - showLoader(); - - final relativePath = await FileCopy(objectsDirectory).write(pickedFilePath); - + Future> createSnapshotFromFile({ + required final String pickedFilePath, + required final String relativePath, + }) async { final transBytes = await _TransBytes( scanSettings: scanSettings, ).calc(); diff --git a/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart b/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart index 1a9d6fdd..eab281da 100644 --- a/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart +++ b/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart @@ -9,6 +9,8 @@ import 'package:logger/logger.dart'; import 'package:threedpass/core/widgets/buttons/elevated_button.dart'; import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart'; import 'package:threedpass/features/hashes_list/domain/entities/objects_directory.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/file_copy.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/file_picker.dart'; import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/snapshot_create_from_file.dart'; import 'package:threedpass/features/home_page/bloc/home_context_cubit.dart'; import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart'; @@ -52,14 +54,27 @@ class GetObjectFromFileFloatingButton extends StatelessWidget { hashesListBloc: BlocProvider.of(context), scanSettings: BlocProvider.of(context).state.scanSettings, - objectsDirectory: getIt(), + // objectsDirectory: getIt(), scanIsolateCubit: BlocProvider.of(context), // recievePort: recievePort, ); try { - final pair = await snapFactory.createSnapshotFromFile(); + final objectsDirectory = getIt(); + final pickedFilePath = await FilePickerShortCut().pickFile(); + + showLoader(context); + + final relativePath = + await FileCopy(objectsDirectory).write(pickedFilePath); + + final pair = await snapFactory.createSnapshotFromFile( + relativePath: relativePath, + pickedFilePath: pickedFilePath, + ); + hideLoader(context); + unawaited( context.router.push( PreviewRouteWrapper( diff --git a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart index 4294c1a5..99162c67 100644 --- a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart +++ b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart @@ -1,6 +1,7 @@ import 'package:copy_with_extension/copy_with_extension.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:polkawallet_sdk/api/types/txInfoData.dart'; import 'package:threedpass/core/polkawallet/app_service.dart'; import 'package:threedpass/core/polkawallet/utils/transfer_type.dart'; @@ -60,21 +61,25 @@ class TransferInfoCubit extends Cubit { required final String password, required final GlobalKey formKey, }) async { - final txInfo = metaDTO.getTxInfo(state.type); - final params = metaDTO.getParams( - amount, - toAddress, - ); + try { + final txInfo = metaDTO.getTxInfo(state.type); + final params = metaDTO.getParams( + amount, + toAddress, + ); - await Transfer( - txInfo: txInfo, - params: params, - appService: appService, - context: context, - toAddress: toAddress, - password: password, - formKey: formKey, - ).sendFunds(); + await Transfer( + txInfo: txInfo, + params: params, + appService: appService, + context: context, + toAddress: toAddress, + password: password, + formKey: formKey, + ).sendFunds(); + } on Exception catch (e) { + await Fluttertoast.showToast(msg: e.toString()); + } } void updateTransferType(final TransferType type) { From 32b8e3dfd5ccecb6f560c90f1b91374f97789920 Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Sun, 13 Aug 2023 19:09:07 +0300 Subject: [PATCH 09/12] FIX: Matches count & link to website --- .../domain/entities/matches_count.dart | 35 +++++++++++++++++++ .../widgets/matches_found/matches_found.dart | 26 +++++++++----- .../matches_found/no_matches_found_text.dart | 2 +- .../bloc/transfer_info_cubit.dart | 18 +++++----- 4 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 lib/features/hashes_list/domain/entities/matches_count.dart diff --git a/lib/features/hashes_list/domain/entities/matches_count.dart b/lib/features/hashes_list/domain/entities/matches_count.dart new file mode 100644 index 00000000..91a0310b --- /dev/null +++ b/lib/features/hashes_list/domain/entities/matches_count.dart @@ -0,0 +1,35 @@ +import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart'; + +/// Calc how many snapshots include same hashes as the given snapshot +class MatchesCount { + final HashObject? object; + final Snapshot snapshot; + + const MatchesCount({ + required this.object, + required this.snapshot, + }); + + int get matchesCount { + if (object == null) { + return 0; + } + + final list = List.from(object!.snapshots); + list.remove(snapshot); + + var matches = 0; + + for (final s in list) { + for (final hash in snapshot.hashes) { + if (s.hashes.contains(hash)) { + matches++; + break; + } + } + } + + return matches; + } +} diff --git a/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart b/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart index ad0a154c..ad4acef8 100644 --- a/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart +++ b/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:threedpass/core/widgets/error_page.dart'; +import 'package:threedpass/features/hashes_list/domain/entities/matches_count.dart'; import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart'; import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/matches_found_text.dart'; import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart'; @@ -18,16 +19,23 @@ class MatchesFound extends StatelessWidget { case PreviewNewObject: return const NoMatchesFoundText(); case PreviewNewSnapshot: - return MatchesFoundText( - state: state, - number: state.hashObject!.snapshots - .length, // TODO Calc real mathches, not just count snapshots - ); case PreviewExistingSnapshot: - return MatchesFoundText( - state: state, - number: state.hashObject!.snapshots.length - 1, - ); + final mc = + MatchesCount(object: state.hashObject, snapshot: state.snapshot); + + if (mc.matchesCount == 0) { + return const NoMatchesFoundText(); + } else { + return MatchesFoundText( + state: state, + number: mc.matchesCount, + ); + } + + // return MatchesFoundText( + // state: state, + // number: state.hashObject!.snapshots.length - 1, + // ); default: return const ErrorPage( error: '[MatchesFound] Unknown state for PreviewPageCubitState', diff --git a/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart b/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart index a92ddff2..430c844f 100644 --- a/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart +++ b/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart @@ -12,7 +12,7 @@ class NoMatchesFoundText extends StatelessWidget { mainText: plural('MATCHES_number_plural', 0), clickable: 'WHY_not_found'.tr(), onTap: () => launchUrlString( - 'https://3dpass.org/features.html#3D_object_recognition', + 'https://3dpass.org/features#3drecognition', ), ); } diff --git a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart index 99162c67..ab82579f 100644 --- a/lib/features/wallet_screen/bloc/transfer_info_cubit.dart +++ b/lib/features/wallet_screen/bloc/transfer_info_cubit.dart @@ -27,16 +27,16 @@ class TransferInfoCubit extends Cubit { final AppService appService; Future init() async { - final params = [ - appService.keyring.allWithContacts.first.address, - '10000000000', - ]; + // final params = [ + // appService.keyring.allWithContacts.first.address, + // '10000000000', + // ]; - final txInfo = TxInfoData( - 'balances', - TransferTypeValue(state.type).toString(), - appService.userSenderData, - ); + // final txInfo = TxInfoData( + // 'balances', + // TransferTypeValue(state.type).toString(), + // appService.userSenderData, + // ); // This line throws error: // {"path":"log","data":{"call":"uid=8;keyring.txFeeEstimate","error":"t.rpc.payment.queryInfo is not a function"}} From 9749b88d5c705b4fb6732205952f01df07648b76 Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Sun, 13 Aug 2023 19:41:36 +0300 Subject: [PATCH 10/12] FIX: Graphql cache invalidation --- .../extrinsics/data/repositories/extrinsic_datasource.dart | 1 + .../data/repositories/transfers_repository.dart | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/threedp_graphql/lib/features/extrinsics/data/repositories/extrinsic_datasource.dart b/packages/threedp_graphql/lib/features/extrinsics/data/repositories/extrinsic_datasource.dart index 441abe70..46344c2f 100644 --- a/packages/threedp_graphql/lib/features/extrinsics/data/repositories/extrinsic_datasource.dart +++ b/packages/threedp_graphql/lib/features/extrinsics/data/repositories/extrinsic_datasource.dart @@ -17,6 +17,7 @@ class ExtrinsicDatasourceGQL { ) async { final request = GGetExtrinsicsReq((final b) { b + ..fetchPolicy = FetchPolicy.NoCache ..vars.pageKey = requestParams.pageKey ..vars.pageSize = requestParams.pageSize ..vars.filters.blockNumber = diff --git a/packages/threedp_graphql/lib/features/transfers_history/data/repositories/transfers_repository.dart b/packages/threedp_graphql/lib/features/transfers_history/data/repositories/transfers_repository.dart index 175baca6..60e94b04 100644 --- a/packages/threedp_graphql/lib/features/transfers_history/data/repositories/transfers_repository.dart +++ b/packages/threedp_graphql/lib/features/transfers_history/data/repositories/transfers_repository.dart @@ -16,6 +16,7 @@ class TransfersDatasourceGQL { ) async { final request = GGetTransfersReq((final b) { b + ..fetchPolicy = FetchPolicy.NoCache ..vars.pageKey = requestParams.pageKey ..vars.pageSize = requestParams.pageSize ..vars.filters.toMultiAddressAccountId = From 62399c807036b6581e157be14df73b53e78bcdc1 Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Tue, 15 Aug 2023 16:03:55 +0300 Subject: [PATCH 11/12] Accounts drawer redesign --- assets/translations/en.json | 2 +- .../widgets/buttons/list_tile_button.dart | 30 +++++++----- lib/core/widgets/buttons/text_button.dart | 24 ++++++++-- lib/core/widgets/other/right_chevron.dart | 22 +++++++++ .../widgets/default_settings_button.dart | 23 ++------- .../hash_settings/algorithm_dropdown.dart | 47 ------------------- .../assets_page/widgets/accounts_drawer.dart | 6 ++- .../events_datasource_remote.dart | 1 + .../entities/transfers_request_params.dart | 2 +- 9 files changed, 69 insertions(+), 88 deletions(-) create mode 100644 lib/core/widgets/other/right_chevron.dart delete mode 100644 lib/features/settings_page/presentation/widgets/hash_settings/algorithm_dropdown.dart diff --git a/assets/translations/en.json b/assets/translations/en.json index 5ecc00cb..8cb40254 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -132,7 +132,7 @@ "@wallet_base":{ }, "wallet_header_title": "Wallet", - "create_account_button_label": "New random account", + "create_account_button_label": "Random account", "import_account_button_label": "Import account", "init_status_sdk": "Initializing...", diff --git a/lib/core/widgets/buttons/list_tile_button.dart b/lib/core/widgets/buttons/list_tile_button.dart index ce249575..a3f94007 100644 --- a/lib/core/widgets/buttons/list_tile_button.dart +++ b/lib/core/widgets/buttons/list_tile_button.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; import 'package:threedpass/core/theme/d3p_special_styles.dart'; import 'package:threedpass/core/theme/d3p_theme.dart'; +import 'package:threedpass/core/widgets/other/right_chevron.dart'; class ListTileButton extends StatelessWidget { const ListTileButton.bottom({ @@ -70,20 +71,23 @@ class ListTileButton extends StatelessWidget { padding: padding ?? EdgeInsets.zero, child: SizedBox( child: PlatformTextButton( + padding: EdgeInsets.zero, onPressed: onPressed, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - text, - style: theme.customTextStyles.d3plabelLarge - .copyWith(color: mainColor), - ), - Icon( - Icons.arrow_right_rounded, - color: mainColor, - ), - ], + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + text, + style: theme.customTextStyles.d3plabelLarge + .copyWith(color: mainColor), + ), + RightChevron( + color: mainColor, + ), + ], + ), ), material: (final context, final platform) => _ListTileMaterial( themeData: theme, diff --git a/lib/core/widgets/buttons/text_button.dart b/lib/core/widgets/buttons/text_button.dart index 34327782..ee0c90b9 100644 --- a/lib/core/widgets/buttons/text_button.dart +++ b/lib/core/widgets/buttons/text_button.dart @@ -11,6 +11,8 @@ class D3pTextButton extends StatelessWidget { this.padding, this.onPressed, this.textColor, + this.icon, + this.mainAxisAlignment = MainAxisAlignment.center, }) : super(key: key); final void Function()? onPressed; @@ -19,6 +21,8 @@ class D3pTextButton extends StatelessWidget { final String text; final Color? textColor; final double? width; + final IconData? icon; + final MainAxisAlignment mainAxisAlignment; @override Widget build(final BuildContext context) { @@ -36,11 +40,21 @@ class D3pTextButton extends StatelessWidget { ), ), cupertino: (final _, final __) => CupertinoTextButtonData(), - child: Text( - text, - style: TextStyle( - color: textColor ?? D3pThemeData.mainColor, - ), + child: Row( + mainAxisAlignment: mainAxisAlignment, + children: [ + if (icon != null) + Padding( + padding: EdgeInsets.only(right: 8), + child: Icon(icon), + ), + Text( + text, + style: TextStyle( + color: textColor ?? D3pThemeData.mainColor, + ), + ), + ], ), ), ), diff --git a/lib/core/widgets/other/right_chevron.dart b/lib/core/widgets/other/right_chevron.dart new file mode 100644 index 00000000..9375da35 --- /dev/null +++ b/lib/core/widgets/other/right_chevron.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:threedpass/core/theme/d3p_special_colors.dart'; + +class RightChevron extends StatelessWidget { + const RightChevron({ + super.key, + this.color, + }); + + final Color? color; + + @override + Widget build(final BuildContext context) { + final colors = Theme.of(context).customColors; + final iconColor = colors.moreFadedGrey; + return Icon( + Icons.arrow_forward_ios_outlined, + size: 16, + color: color ?? iconColor, + ); + } +} diff --git a/lib/features/settings_page/presentation/widgets/default_settings_button.dart b/lib/features/settings_page/presentation/widgets/default_settings_button.dart index 03686e29..ce9e0af3 100644 --- a/lib/features/settings_page/presentation/widgets/default_settings_button.dart +++ b/lib/features/settings_page/presentation/widgets/default_settings_button.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; import 'package:threedpass/core/theme/d3p_colors.dart'; -import 'package:threedpass/core/theme/d3p_special_colors.dart'; import 'package:threedpass/core/theme/d3p_special_styles.dart'; import 'package:threedpass/core/utils/empty_function.dart'; +import 'package:threedpass/core/widgets/other/right_chevron.dart'; import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart'; class DefaultSettingsButton extends StatelessWidget { @@ -45,7 +45,7 @@ class DefaultSettingsButton extends StatelessWidget { final Color iconColor; final String text; final String? textValue; - final void Function() onPressed; + final void Function()? onPressed; final bool isBoolean; final bool? initialValue; final void Function(bool) onPressedBool; @@ -68,7 +68,7 @@ class DefaultSettingsButton extends StatelessWidget { final wrappedChild = isBoolean ? child : InkWell( - onTap: () => onPressed(), + onTap: onPressed != null ? () => onPressed!() : null, child: child, ); @@ -183,7 +183,7 @@ class _Value extends StatelessWidget { Flexible( child: _ValueText(value: value), ), - const _RightChevron(), + const RightChevron(), ], ); } @@ -273,18 +273,3 @@ class _ValueText extends StatelessWidget { } } } - -class _RightChevron extends StatelessWidget { - const _RightChevron(); - - @override - Widget build(final BuildContext context) { - final colors = Theme.of(context).customColors; - final iconColor = colors.moreFadedGrey; - return Icon( - Icons.arrow_forward_ios_outlined, - size: 16, - color: iconColor, - ); - } -} diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_dropdown.dart b/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_dropdown.dart deleted file mode 100644 index 4f21e2d7..00000000 --- a/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_dropdown.dart +++ /dev/null @@ -1,47 +0,0 @@ -// part of '../../settings_page.dart'; - -// class _AlgorithmDropdown extends StatelessWidget { -// const _AlgorithmDropdown({final Key? key}) : super(key: key); - -// Future _onAlgorithmChanged( -// final BuildContext context, -// final String? newValue, -// ) async { -// if (newValue != null) { -// final cubit = BlocProvider.of(context); - -// final newScanConfig = -// cubit.state.scanSettings.copyWith(algorithm: newValue); -// final newState = cubit.state.copyWith(scanSettings: newScanConfig); -// cubit.updateSettings(newState); -// } -// } - -// @override -// Widget build(final BuildContext context) { -// // TODO Show warning when user chooses not the latest algo -// return BlocBuilder( -// buildWhen: (final previous, final current) => false, -// builder: (final context, final state) => -// D3pDropdownButtonFormField( -// context: context, -// label: 'choose_algorithm_label', -// value: state.scanSettings.algorithm, -// onChanged: (final String? newValue) => -// _onAlgorithmChanged(context, newValue), -// items: _AlgorithmDropdownMenuItems().items, -// ), -// ); -// } -// } - -// class _AlgorithmDropdownMenuItems { -// List> get items => AlgorithmMaster.list -// .map( -// (final e) => DropdownMenuItem( -// value: e, -// child: Text(e), -// ), -// ) -// .toList(); -// } diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart index ddd126c8..e742fc9b 100644 --- a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart +++ b/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart @@ -41,12 +41,16 @@ class AccountsDrawer extends Drawer { const SizedBox(height: 4), D3pTextButton( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + mainAxisAlignment: MainAxisAlignment.start, + icon: Icons.add_circle, text: 'create_account_button_label'.tr(), onPressed: () => CreateAccountPageWrapper.pushToGenerateRandom(context), ), D3pTextButton( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + mainAxisAlignment: MainAxisAlignment.start, + icon: Icons.import_export, text: 'import_account_button_label'.tr(), onPressed: () => CreateAccountPageWrapper.pushToImportType(context), @@ -66,8 +70,6 @@ class AccountsDrawer extends Drawer { .changeAccount(accounts[index]); Navigator.of(context).pop(); }, - // backgroundColor: Theme.of(context).canvasColor, - padding: const EdgeInsets.symmetric(horizontal: 8), ), ), ), diff --git a/packages/threedp_graphql/lib/features/events/data/repositories/events_datasource_remote.dart b/packages/threedp_graphql/lib/features/events/data/repositories/events_datasource_remote.dart index 02eebbfb..985b04b4 100644 --- a/packages/threedp_graphql/lib/features/events/data/repositories/events_datasource_remote.dart +++ b/packages/threedp_graphql/lib/features/events/data/repositories/events_datasource_remote.dart @@ -18,6 +18,7 @@ class EventsDatasourceGQL { ) async { final request = GGetEventsReq((final b) { b + ..fetchPolicy = FetchPolicy.CacheFirst ..vars.pageKey = requestParams.pageKey ..vars.pageSize = requestParams.pageSize ..vars.filters.blockNumber = requestParams.blockNumber.toString() diff --git a/packages/threedp_graphql/lib/features/transfers_history/domain/entities/transfers_request_params.dart b/packages/threedp_graphql/lib/features/transfers_history/domain/entities/transfers_request_params.dart index d9d46e25..aab24a4d 100644 --- a/packages/threedp_graphql/lib/features/transfers_history/domain/entities/transfers_request_params.dart +++ b/packages/threedp_graphql/lib/features/transfers_history/domain/entities/transfers_request_params.dart @@ -8,7 +8,7 @@ class GetTransfersParams extends Equatable { const GetTransfersParams({ required this.pageKey, - this.pageSize = 15, + this.pageSize = 25, this.toMultiAddressAccountId, this.fromMultiAddressAccountId, }); From eb184f1d263de2ca7aaecaa1ddefe69d1c19e96f Mon Sep 17 00:00:00 2001 From: L3odr0id Date: Tue, 15 Aug 2023 16:27:36 +0300 Subject: [PATCH 12/12] Version 2.7.2+28 --- pubspec.lock | 47 +++++++++++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 7 ++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index cfc83f65..b5068cf5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -73,6 +73,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.1.1" + badges: + dependency: "direct main" + description: + name: badges + sha256: "6e7f3ec561ec08f47f912cfe349d4a1707afdc8dda271e17b046aa6d42c89e77" + url: "https://pub.dev" + source: hosted + version: "3.1.1" bip32: dependency: transitive description: @@ -485,6 +493,11 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.3" + flutter_driver: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" flutter_gl: dependency: "direct main" description: @@ -684,6 +697,11 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" get: dependency: transitive description: @@ -844,6 +862,11 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.0" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" intl: dependency: "direct main" description: @@ -1417,6 +1440,14 @@ packages: relative: true source: path version: "0.0.1" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" + source: hosted + version: "0.3.1" term_glyph: dependency: transitive description: @@ -1610,6 +1641,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe + url: "https://pub.dev" + source: hosted + version: "11.3.0" wallet: dependency: transitive description: @@ -1642,6 +1681,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.0" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" + source: hosted + version: "3.0.2" webview_flutter: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index fa86cc1a..512881d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ publish_to: 'none' # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.7.1+27 +version: 2.7.2+28 environment: sdk: ">=3.0.6 <3.0.7" @@ -40,6 +40,7 @@ dependencies: flutter_svg: ^2.0.7 fluttertoast: ^8.2.2 infinite_scroll_pagination: ^3.2.0 + badges: ^3.1.1 unicons: ^2.1.0 url_launcher: ^6.1.12 @@ -87,6 +88,8 @@ dependencies: gql_code_builder: ^0.6.0 # Fix compilations. Do not remove dev_dependencies: + integration_test: + sdk: flutter flutter_test: sdk: flutter @@ -117,3 +120,5 @@ flutter: - assets/textures/ - assets/translations/ + - test/resources/ +