From e836337253d473d310bf170b0bd9a83d508277b1 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 19 Dec 2022 09:28:37 -0700 Subject: [PATCH 1/5] Merge branch 'desktop' of /home/rylee/Desktop/publishing/stack_wallet with conflicts. --- .../restore_options_view.dart | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart index dac2af028..d9c3d528b 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart @@ -10,7 +10,7 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_o import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart'; import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart'; import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart'; -import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; +import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/ui/color_theme_provider.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -23,8 +23,6 @@ import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart'; -import 'package:stackwallet/widgets/rounded_date_picker/flutter_rounded_date_picker_widget.dart' - as datePicker; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:tuple/tuple.dart'; @@ -154,10 +152,46 @@ class _RestoreOptionsViewState extends ConsumerState { await Future.delayed(const Duration(milliseconds: 125)); } - final date = await datePicker.showRoundedDatePicker( + final date = await showRoundedDatePicker( context: context, initialDate: DateTime.now(), - height: height * 0.5, + height: height / 3.0, + theme: ThemeData( + primarySwatch: Util.createMaterialColor(fetchedColor), + ), + //TODO pick a better initial date + // 2007 chosen as that is just before bitcoin launched + firstDate: DateTime(2007), + lastDate: DateTime.now(), + borderRadius: Constants.size.circularBorderRadius * 2, + + textPositiveButton: "SELECT", + + styleDatePicker: _buildDatePickerStyle(), + styleYearPicker: _buildYearPickerStyle(), + ); + if (date != null) { + _restoreFromDate = date; + _dateController.text = Format.formatDate(date); + } + } + + Future chooseDesktopDate() async { + final height = MediaQuery.of(context).size.height; + final fetchedColor = + Theme.of(context).extension()!.accentColorDark; + // check and hide keyboard + if (FocusScope.of(context).hasFocus) { + FocusScope.of(context).unfocus(); + await Future.delayed(const Duration(milliseconds: 125)); + } + + final now = DateTime.now(); + + final date = await showRoundedDatePicker( + context: context, + initialDate: DateTime.now(), + height: height / 3.0, theme: ThemeData( primarySwatch: Util.createMaterialColor(fetchedColor), ), @@ -283,15 +317,17 @@ class _RestoreOptionsViewState extends ConsumerState { (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == 25)) - - // if (!isDesktop) + if (!isDesktop) + RestoreFromDatePicker( + onTap: chooseDate, + controller: _dateController, + ), + if (isDesktop) + // TODO desktop date picker RestoreFromDatePicker( - onTap: chooseDate, + onTap: chooseDesktopDate, controller: _dateController, ), - - // if (isDesktop) - // // TODO desktop date picker if (coin == Coin.monero || coin == Coin.epicCash || (coin == Coin.wownero && @@ -412,7 +448,6 @@ class _RestoreOptionsViewState extends ConsumerState { isDesktop: isDesktop, onPressed: _nextEnabled ? nextPressed : null, ), - if (isDesktop) const Spacer( flex: 15, From 28f9fcaa0a2233e99a60c32a59457bd6101a0129 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 19 Dec 2022 09:29:47 -0700 Subject: [PATCH 2/5] added another todo: check print --- lib/services/coins/bitcoincash/bitcoincash_wallet.dart | 4 ++-- lib/services/notes_service.dart | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index c5c3f22b1..c9499b054 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -2666,8 +2666,8 @@ class BitcoinCashWallet extends CoinServiceAPI { ], // dust limit is the minimum amount a change output should be ))["vSize"] as int; //todo: check if print needed - debugPrint("vSizeForOneOutput $vSizeForOneOutput"); - debugPrint("vSizeForTwoOutPuts $vSizeForTwoOutPuts"); + // debugPrint("vSizeForOneOutput $vSizeForOneOutput"); + // debugPrint("vSizeForTwoOutPuts $vSizeForTwoOutPuts"); // Assume 1 output, only for recipient and no change var feeForOneOutput = estimateTxFee( diff --git a/lib/services/notes_service.dart b/lib/services/notes_service.dart index cffe770e5..013600625 100644 --- a/lib/services/notes_service.dart +++ b/lib/services/notes_service.dart @@ -51,6 +51,7 @@ class NotesService extends ChangeNotifier { _notes[txid] = note; await DB.instance .put(boxName: walletId, key: 'notes', value: _notes); + //todo: check if this is needed Logging.instance.log("editOrAddNote: tx note saved", level: LogLevel.Info); await _refreshNotes(); } From 101de01fa230cc1ce6db31d637120384d4990286 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 20 Dec 2022 10:08:14 -0600 Subject: [PATCH 3/5] update default btc testnet electrumx url --- lib/utilities/default_nodes.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utilities/default_nodes.dart b/lib/utilities/default_nodes.dart index f4eb41b7c..e45e33aec 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -158,7 +158,7 @@ abstract class DefaultNodes { isDown: false); static NodeModel get bitcoinTestnet => NodeModel( - host: "electrumx-testnet.cypherstack.com", + host: "bitcoin-testnet.cypherstack.com", port: 51002, name: defaultName, id: _nodeId(Coin.bitcoinTestNet), From ce79cfacbf6d50cde6e805d45405d003886e98d3 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 26 Dec 2022 17:51:24 -0700 Subject: [PATCH 4/5] commented out ExitToMyStackButton --- .../restore_options_view/restore_options_view.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart index d9c3d528b..187e81190 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart @@ -10,7 +10,7 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_o import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart'; import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart'; import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart'; -import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart'; +// import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/ui/color_theme_provider.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -241,7 +241,7 @@ class _RestoreOptionsViewState extends ConsumerState { ? const DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), + // trailing: ExitToMyStackButton(), ) : AppBar( leading: AppBarBackButton( From 015e2f4b84fb7ff5192561440a4f199fd38d0092 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 26 Dec 2022 17:54:18 -0700 Subject: [PATCH 5/5] correct import for ExitToMyStack --- .../restore_options_view/restore_options_view.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart index 187e81190..7c5890cc7 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart @@ -10,7 +10,7 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_o import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart'; import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart'; import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart'; -// import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart'; +import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/ui/color_theme_provider.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -241,7 +241,7 @@ class _RestoreOptionsViewState extends ConsumerState { ? const DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - // trailing: ExitToMyStackButton(), + trailing: ExitToMyStackButton(), ) : AppBar( leading: AppBarBackButton(