remove problematic imports and duplicate changes

This commit is contained in:
fosse 2023-10-05 10:31:04 -04:00
parent e33b3d5266
commit 2e0234ab28
7 changed files with 69 additions and 68 deletions

View file

@ -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:cake_wallet/core/wallet_loading_service.dart';
import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/crypto_currency.dart';
import 'package:cake_wallet/entities/qr_view_data.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'; import 'core/totp_request_details.dart';
@ -776,7 +775,7 @@ Future<void> setup({
nodeCreateOrEditViewModel: getIt.get<NodeCreateOrEditViewModel>(param2: true), nodeCreateOrEditViewModel: getIt.get<NodeCreateOrEditViewModel>(param2: true),
editingNode: editingNode, editingNode: editingNode,
isSelected: isSelected)); isSelected: isSelected));
getIt.registerFactory<RobinhoodBuyProvider>( getIt.registerFactory<RobinhoodBuyProvider>(
() => RobinhoodBuyProvider(wallet: getIt.get<AppStore>().wallet!)); () => RobinhoodBuyProvider(wallet: getIt.get<AppStore>().wallet!));

View file

@ -52,8 +52,6 @@ Future<void> defaultSettingsMigration(
await sharedPreferences.setBool(PreferencesKey.isNewInstall, isNewInstall); await sharedPreferences.setBool(PreferencesKey.isNewInstall, isNewInstall);
await sharedPreferences.setBool(PreferencesKey.isNewInstall, isNewInstall);
final currentVersion = final currentVersion =
sharedPreferences.getInt(PreferencesKey.currentDefaultSettingsMigrationVersion) ?? 0; sharedPreferences.getInt(PreferencesKey.currentDefaultSettingsMigrationVersion) ?? 0;

View file

@ -15,8 +15,7 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
class PowNodeCreateOrEditPage extends BasePage { class PowNodeCreateOrEditPage extends BasePage {
PowNodeCreateOrEditPage( PowNodeCreateOrEditPage({required this.nodeCreateOrEditViewModel,this.editingNode, this.isSelected})
{required this.nodeCreateOrEditViewModel, this.editingNode, this.isSelected})
: _formKey = GlobalKey<FormState>(), : _formKey = GlobalKey<FormState>(),
_addressController = TextEditingController(), _addressController = TextEditingController(),
_portController = TextEditingController(), _portController = TextEditingController(),
@ -48,12 +47,14 @@ class PowNodeCreateOrEditPage extends BasePage {
}); });
} }
_addressController _addressController.addListener(
.addListener(() => nodeCreateOrEditViewModel.address = _addressController.text); () => nodeCreateOrEditViewModel.address = _addressController.text);
_portController.addListener(() => nodeCreateOrEditViewModel.port = _portController.text); _portController.addListener(
_loginController.addListener(() => nodeCreateOrEditViewModel.login = _loginController.text); () => nodeCreateOrEditViewModel.port = _portController.text);
_passwordController _loginController.addListener(
.addListener(() => nodeCreateOrEditViewModel.password = _passwordController.text); () => nodeCreateOrEditViewModel.login = _loginController.text);
_passwordController.addListener(
() => nodeCreateOrEditViewModel.password = _passwordController.text);
} }
final GlobalKey<FormState> _formKey; final GlobalKey<FormState> _formKey;
@ -77,42 +78,45 @@ class PowNodeCreateOrEditPage extends BasePage {
'assets/images/qr_code_icon.png', 'assets/images/qr_code_icon.png',
), ),
); );
final NodeCreateOrEditViewModel nodeCreateOrEditViewModel; final NodeCreateOrEditViewModel nodeCreateOrEditViewModel;
final Node? editingNode; final Node? editingNode;
final bool? isSelected; final bool? isSelected;
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
reaction((_) => nodeCreateOrEditViewModel.connectionState, (ExecutionState state) {
if (state is ExecutedSuccessfullyState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showPopUp<void>(
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) { reaction((_) => nodeCreateOrEditViewModel.connectionState,
WidgetsBinding.instance.addPostFrameCallback((_) { (ExecutionState state) {
showPopUp<void>( if (state is ExecutedSuccessfullyState) {
context: context, WidgetsBinding.instance.addPostFrameCallback((_) {
builder: (BuildContext context) { showPopUp<void>(
return AlertWithOneAction( context: context,
alertTitle: S.of(context).error, builder: (BuildContext context) =>
alertContent: state.error, AlertWithOneAction(
buttonText: S.of(context).ok, alertTitle: S.of(context).new_node_testing,
buttonAction: () => Navigator.of(context).pop()); 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<void>(
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( return Container(
padding: EdgeInsets.only(left: 24, right: 24), padding: EdgeInsets.only(left: 24, right: 24),
@ -137,12 +141,19 @@ class PowNodeCreateOrEditPage extends BasePage {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(
alertTitle: S.of(context).remove_node, alertTitle:
alertContent: S.of(context).remove_node_message, S.of(context).remove_node,
rightButtonText: S.of(context).remove, alertContent: S
leftButtonText: S.of(context).cancel, .of(context)
actionRightButton: () => Navigator.pop(context, true), .remove_node_message,
actionLeftButton: () => Navigator.pop(context, false)); rightButtonText:
S.of(context).remove,
leftButtonText:
S.of(context).cancel,
actionRightButton: () =>
Navigator.pop(context, true),
actionLeftButton: () =>
Navigator.pop(context, false));
}) ?? }) ??
false; false;
@ -152,7 +163,8 @@ class PowNodeCreateOrEditPage extends BasePage {
} }
}, },
text: S.of(context).delete, text: S.of(context).delete,
isDisabled: !nodeCreateOrEditViewModel.isReady || (isSelected ?? false), isDisabled: !nodeCreateOrEditViewModel.isReady ||
(isSelected ?? false),
color: Palette.red, color: Palette.red,
textColor: Colors.white), textColor: Colors.white),
)), )),
@ -161,8 +173,7 @@ class PowNodeCreateOrEditPage extends BasePage {
padding: EdgeInsets.only(left: 8.0), padding: EdgeInsets.only(left: 8.0),
child: PrimaryButton( child: PrimaryButton(
onPressed: () async { onPressed: () async {
if (_formKey.currentState != null && if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
!_formKey.currentState!.validate()) {
return; return;
} }
@ -173,12 +184,13 @@ class PowNodeCreateOrEditPage extends BasePage {
text: S.of(context).save, text: S.of(context).save,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
textColor: Colors.white, textColor: Colors.white,
isDisabled: (!nodeCreateOrEditViewModel.isReady) || isDisabled: (!nodeCreateOrEditViewModel.isReady)||
(nodeCreateOrEditViewModel.connectionState is IsExecutingState), (nodeCreateOrEditViewModel
.connectionState is IsExecutingState),
), ),
)), )),
], ],
)), )),
)); ));
} }
} }

View file

@ -1,8 +1,5 @@
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/generated/i18n.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/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:cake_wallet/view_model/wallet_restore_choose_derivation_view_model.dart';
import 'package:cw_core/wallet_info.dart'; import 'package:cw_core/wallet_info.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -13,15 +10,14 @@ class WalletRestoreChooseDerivationPage extends BasePage {
WalletRestoreChooseDerivationPage(this.walletRestoreChooseDerivationViewModel) {} WalletRestoreChooseDerivationPage(this.walletRestoreChooseDerivationViewModel) {}
@override @override
Widget middle(BuildContext context) => Observer( Widget middle(BuildContext context) => Text(
builder: (_) => Text( S.current.choose_derivation,
S.current.choose_derivation, style: TextStyle(
style: TextStyle( fontSize: 18.0,
fontSize: 18.0, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontFamily: 'Lato',
fontFamily: 'Lato', color: titleColor(context)),
color: titleColor(context)), );
));
final WalletRestoreChooseDerivationViewModel walletRestoreChooseDerivationViewModel; final WalletRestoreChooseDerivationViewModel walletRestoreChooseDerivationViewModel;
DerivationType derivationType = DerivationType.unknown; DerivationType derivationType = DerivationType.unknown;

View file

@ -1,7 +1,6 @@
import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart'; import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart';
import 'package:cake_wallet/entities/buy_provider_types.dart'; import 'package:cake_wallet/entities/buy_provider_types.dart';
import 'package:cake_wallet/entities/exchange_api_mode.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/store/anonpay/anonpay_transactions_store.dart';
import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart'; import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
import 'package:cake_wallet/view_model/settings/sync_mode.dart'; import 'package:cake_wallet/view_model/settings/sync_mode.dart';

View file

@ -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:cake_wallet/view_model/dashboard/balance_view_model.dart';
import 'package:cw_core/keyable.dart'; import 'package:cw_core/keyable.dart';
import 'package:cw_core/wallet_type.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 { class TransactionListItem extends ActionListItem with Keyable {
TransactionListItem( TransactionListItem(

View file

@ -11,7 +11,6 @@ import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
import 'package:cw_core/transaction_priority.dart'; import 'package:cw_core/transaction_priority.dart';
import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/output.dart';
import 'package:cake_wallet/view_model/send/send_template_view_model.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:hive/hive.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:cake_wallet/entities/template.dart'; import 'package:cake_wallet/entities/template.dart';