diff --git a/lib/di.dart b/lib/di.dart index f17e2969f..b572c4b98 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -217,7 +217,6 @@ import 'package:cake_wallet/src/screens/receive/fullscreen_qr_page.dart'; import 'package:cake_wallet/core/wallet_loading_service.dart'; import 'package:cw_core/crypto_currency.dart'; import 'package:cake_wallet/entities/qr_view_data.dart'; -import 'package:cake_wallet/nano/nano.dart' as nanoNano; import 'core/totp_request_details.dart'; @@ -776,7 +775,7 @@ Future setup({ nodeCreateOrEditViewModel: getIt.get(param2: true), editingNode: editingNode, isSelected: isSelected)); - + getIt.registerFactory( () => RobinhoodBuyProvider(wallet: getIt.get().wallet!)); diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 5f9ca906d..c0202d895 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -52,8 +52,6 @@ Future defaultSettingsMigration( await sharedPreferences.setBool(PreferencesKey.isNewInstall, isNewInstall); - await sharedPreferences.setBool(PreferencesKey.isNewInstall, isNewInstall); - final currentVersion = sharedPreferences.getInt(PreferencesKey.currentDefaultSettingsMigrationVersion) ?? 0; diff --git a/lib/src/screens/nodes/pow_node_create_or_edit_page.dart b/lib/src/screens/nodes/pow_node_create_or_edit_page.dart index e4ea1f9ad..8460579ef 100644 --- a/lib/src/screens/nodes/pow_node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/pow_node_create_or_edit_page.dart @@ -15,8 +15,7 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; class PowNodeCreateOrEditPage extends BasePage { - PowNodeCreateOrEditPage( - {required this.nodeCreateOrEditViewModel, this.editingNode, this.isSelected}) + PowNodeCreateOrEditPage({required this.nodeCreateOrEditViewModel,this.editingNode, this.isSelected}) : _formKey = GlobalKey(), _addressController = TextEditingController(), _portController = TextEditingController(), @@ -48,12 +47,14 @@ class PowNodeCreateOrEditPage extends BasePage { }); } - _addressController - .addListener(() => nodeCreateOrEditViewModel.address = _addressController.text); - _portController.addListener(() => nodeCreateOrEditViewModel.port = _portController.text); - _loginController.addListener(() => nodeCreateOrEditViewModel.login = _loginController.text); - _passwordController - .addListener(() => nodeCreateOrEditViewModel.password = _passwordController.text); + _addressController.addListener( + () => nodeCreateOrEditViewModel.address = _addressController.text); + _portController.addListener( + () => nodeCreateOrEditViewModel.port = _portController.text); + _loginController.addListener( + () => nodeCreateOrEditViewModel.login = _loginController.text); + _passwordController.addListener( + () => nodeCreateOrEditViewModel.password = _passwordController.text); } final GlobalKey _formKey; @@ -77,42 +78,45 @@ class PowNodeCreateOrEditPage extends BasePage { 'assets/images/qr_code_icon.png', ), ); - + final NodeCreateOrEditViewModel nodeCreateOrEditViewModel; final Node? editingNode; final bool? isSelected; @override Widget body(BuildContext context) { - reaction((_) => nodeCreateOrEditViewModel.connectionState, (ExecutionState state) { - if (state is ExecutedSuccessfullyState) { - WidgetsBinding.instance.addPostFrameCallback((_) { - showPopUp( - context: context, - builder: (BuildContext context) => AlertWithOneAction( - alertTitle: S.of(context).new_node_testing, - alertContent: state.payload as bool - ? S.of(context).node_connection_successful - : S.of(context).node_connection_failed, - buttonText: S.of(context).ok, - buttonAction: () => Navigator.of(context).pop())); - }); - } - if (state is FailureState) { - WidgetsBinding.instance.addPostFrameCallback((_) { - showPopUp( - context: context, - builder: (BuildContext context) { - return AlertWithOneAction( - alertTitle: S.of(context).error, - alertContent: state.error, - buttonText: S.of(context).ok, - buttonAction: () => Navigator.of(context).pop()); - }); + reaction((_) => nodeCreateOrEditViewModel.connectionState, + (ExecutionState state) { + if (state is ExecutedSuccessfullyState) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showPopUp( + context: context, + builder: (BuildContext context) => + AlertWithOneAction( + alertTitle: S.of(context).new_node_testing, + alertContent: state.payload as bool + ? S.of(context).node_connection_successful + : S.of(context).node_connection_failed, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop())); + }); + } + + if (state is FailureState) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showPopUp( + context: context, + builder: (BuildContext context) { + return AlertWithOneAction( + alertTitle: S.of(context).error, + alertContent: state.error, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop()); + }); + }); + } }); - } - }); return Container( padding: EdgeInsets.only(left: 24, right: 24), @@ -137,12 +141,19 @@ class PowNodeCreateOrEditPage extends BasePage { context: context, builder: (BuildContext context) { return AlertWithTwoActions( - alertTitle: S.of(context).remove_node, - alertContent: S.of(context).remove_node_message, - rightButtonText: S.of(context).remove, - leftButtonText: S.of(context).cancel, - actionRightButton: () => Navigator.pop(context, true), - actionLeftButton: () => Navigator.pop(context, false)); + alertTitle: + S.of(context).remove_node, + alertContent: S + .of(context) + .remove_node_message, + rightButtonText: + S.of(context).remove, + leftButtonText: + S.of(context).cancel, + actionRightButton: () => + Navigator.pop(context, true), + actionLeftButton: () => + Navigator.pop(context, false)); }) ?? false; @@ -152,7 +163,8 @@ class PowNodeCreateOrEditPage extends BasePage { } }, text: S.of(context).delete, - isDisabled: !nodeCreateOrEditViewModel.isReady || (isSelected ?? false), + isDisabled: !nodeCreateOrEditViewModel.isReady || + (isSelected ?? false), color: Palette.red, textColor: Colors.white), )), @@ -161,8 +173,7 @@ class PowNodeCreateOrEditPage extends BasePage { padding: EdgeInsets.only(left: 8.0), child: PrimaryButton( onPressed: () async { - if (_formKey.currentState != null && - !_formKey.currentState!.validate()) { + if (_formKey.currentState != null && !_formKey.currentState!.validate()) { return; } @@ -173,12 +184,13 @@ class PowNodeCreateOrEditPage extends BasePage { text: S.of(context).save, color: Theme.of(context).primaryColor, textColor: Colors.white, - isDisabled: (!nodeCreateOrEditViewModel.isReady) || - (nodeCreateOrEditViewModel.connectionState is IsExecutingState), + isDisabled: (!nodeCreateOrEditViewModel.isReady)|| + (nodeCreateOrEditViewModel + .connectionState is IsExecutingState), ), )), ], )), )); } -} +} \ No newline at end of file diff --git a/lib/src/screens/restore/wallet_restore_choose_derivation.dart b/lib/src/screens/restore/wallet_restore_choose_derivation.dart index 5cf40e588..4bb661f3c 100644 --- a/lib/src/screens/restore/wallet_restore_choose_derivation.dart +++ b/lib/src/screens/restore/wallet_restore_choose_derivation.dart @@ -1,8 +1,5 @@ -import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/view_model/wallet_restore_choose_derivation_view_model.dart'; import 'package:cw_core/wallet_info.dart'; import 'package:flutter/material.dart'; @@ -13,15 +10,14 @@ class WalletRestoreChooseDerivationPage extends BasePage { WalletRestoreChooseDerivationPage(this.walletRestoreChooseDerivationViewModel) {} @override - Widget middle(BuildContext context) => Observer( - builder: (_) => Text( - S.current.choose_derivation, - style: TextStyle( - fontSize: 18.0, - fontWeight: FontWeight.bold, - fontFamily: 'Lato', - color: titleColor(context)), - )); + Widget middle(BuildContext context) => Text( + S.current.choose_derivation, + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + fontFamily: 'Lato', + color: titleColor(context)), + ); final WalletRestoreChooseDerivationViewModel walletRestoreChooseDerivationViewModel; DerivationType derivationType = DerivationType.unknown; diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart index 3eb028363..03f0aa9a8 100644 --- a/lib/view_model/dashboard/dashboard_view_model.dart +++ b/lib/view_model/dashboard/dashboard_view_model.dart @@ -1,7 +1,6 @@ import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart'; import 'package:cake_wallet/entities/buy_provider_types.dart'; import 'package:cake_wallet/entities/exchange_api_mode.dart'; -import 'package:cake_wallet/nano/nano.dart'; import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart'; import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart'; import 'package:cake_wallet/view_model/settings/sync_mode.dart'; diff --git a/lib/view_model/dashboard/transaction_list_item.dart b/lib/view_model/dashboard/transaction_list_item.dart index 511979d54..e987b60b3 100644 --- a/lib/view_model/dashboard/transaction_list_item.dart +++ b/lib/view_model/dashboard/transaction_list_item.dart @@ -14,8 +14,6 @@ import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart'; import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart'; import 'package:cw_core/keyable.dart'; import 'package:cw_core/wallet_type.dart'; -import 'package:cw_nano/nano_transaction_info.dart'; -import 'package:cw_nano/nano_util.dart'; class TransactionListItem extends ActionListItem with Keyable { TransactionListItem( diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index ff587074c..faebed11f 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -11,7 +11,6 @@ import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart'; import 'package:cw_core/transaction_priority.dart'; import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/send_template_view_model.dart'; -import 'package:cw_nano/nano_wallet.dart'; import 'package:hive/hive.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/entities/template.dart';