From 8b4215c6a1f567589ebe040d69be9e1896cd9b1d Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 13 Sep 2022 16:21:48 -0600 Subject: [PATCH 1/7] Update required btc confirms to 1 --- lib/services/coins/bitcoin/bitcoin_wallet.dart | 2 +- test/services/coins/bitcoin/bitcoin_wallet_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index ae6d7b70a..e1ea02abe 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -42,7 +42,7 @@ import 'package:stackwallet/utilities/prefs.dart'; import 'package:tuple/tuple.dart'; import 'package:uuid/uuid.dart'; -const int MINIMUM_CONFIRMATIONS = 2; +const int MINIMUM_CONFIRMATIONS = 1; const int DUST_LIMIT = 294; const String GENESIS_HASH_MAINNET = diff --git a/test/services/coins/bitcoin/bitcoin_wallet_test.dart b/test/services/coins/bitcoin/bitcoin_wallet_test.dart index dac980155..c2fb76582 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.dart @@ -28,7 +28,7 @@ import 'bitcoin_wallet_test_parameters.dart'; void main() { group("bitcoin constants", () { test("bitcoin minimum confirmations", () async { - expect(MINIMUM_CONFIRMATIONS, 2); + expect(MINIMUM_CONFIRMATIONS, 1); }); test("bitcoin dust limit", () async { expect(DUST_LIMIT, 294); From 40076f3409ea2d7a7354b6d33ae1bba82d0c3ffd Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 14 Sep 2022 10:16:14 -0600 Subject: [PATCH 2/7] Handle clipping of long wallet names on the wallet view title bar --- lib/pages/wallet_view/wallet_view.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 01b2f4ad8..72227092f 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -376,9 +376,13 @@ class _WalletViewState extends ConsumerState { const SizedBox( width: 16, ), - Text( - ref.watch(managerProvider.select((value) => value.walletName)), - style: STextStyles.navBarTitle, + Expanded( + child: Text( + ref.watch( + managerProvider.select((value) => value.walletName)), + style: STextStyles.navBarTitle, + overflow: TextOverflow.ellipsis, + ), ) ], ), From 73ae1c7c9089b3e85058053da6cfbf3cbb6c7f6a Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 14 Sep 2022 10:21:21 -0600 Subject: [PATCH 3/7] Handle clipping of long wallet names on the wallet selection sheet --- lib/widgets/wallet_card.dart | 78 ++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/lib/widgets/wallet_card.dart b/lib/widgets/wallet_card.dart index fd260d009..6601774ce 100644 --- a/lib/widgets/wallet_card.dart +++ b/lib/widgets/wallet_card.dart @@ -79,44 +79,46 @@ class WalletSheetCard extends ConsumerWidget { const SizedBox( width: 12, ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - manager.walletName, - style: STextStyles.titleBold12, - ), - const SizedBox( - height: 2, - ), - FutureBuilder( - future: manager.totalBalance, - builder: (builderContext, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.done && - snapshot.hasData) { - return Text( - "${Format.localizedStringAsFixed( - value: snapshot.data!, - locale: locale, - decimalPlaces: 8, - )} ${coin.ticker}", - style: STextStyles.itemSubtitle, - ); - } else { - return AnimatedText( - stringsToLoopThrough: const [ - "Loading balance", - "Loading balance.", - "Loading balance..", - "Loading balance..." - ], - style: STextStyles.itemSubtitle, - ); - } - }, - ), - ], + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + manager.walletName, + style: STextStyles.titleBold12, + ), + const SizedBox( + height: 2, + ), + FutureBuilder( + future: manager.totalBalance, + builder: (builderContext, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done && + snapshot.hasData) { + return Text( + "${Format.localizedStringAsFixed( + value: snapshot.data!, + locale: locale, + decimalPlaces: 8, + )} ${coin.ticker}", + style: STextStyles.itemSubtitle, + ); + } else { + return AnimatedText( + stringsToLoopThrough: const [ + "Loading balance", + "Loading balance.", + "Loading balance..", + "Loading balance..." + ], + style: STextStyles.itemSubtitle, + ); + } + }, + ), + ], + ), ), ], ), From f61621896c1edc2f3792ef4648959285971f01d5 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 14 Sep 2022 10:38:49 -0600 Subject: [PATCH 4/7] Show wallet name for default/MyStack contact addresses on popup --- lib/models/contact_address_entry.dart | 6 ++++++ lib/pages/address_book_views/address_book_view.dart | 1 + .../address_book_views/subviews/contact_popup.dart | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/lib/models/contact_address_entry.dart b/lib/models/contact_address_entry.dart index 98e4a4cd9..ce85228b6 100644 --- a/lib/models/contact_address_entry.dart +++ b/lib/models/contact_address_entry.dart @@ -6,22 +6,26 @@ class ContactAddressEntry { final Coin coin; final String address; final String label; + final String? other; const ContactAddressEntry({ required this.coin, required this.address, required this.label, + this.other, }); ContactAddressEntry copyWith({ Coin? coin, String? address, String? label, + String? other, }) { return ContactAddressEntry( coin: coin ?? this.coin, address: address ?? this.address, label: label ?? this.label, + other: other ?? this.other, ); } @@ -30,6 +34,7 @@ class ContactAddressEntry { coin: Coin.values.byName(jsonObject["coin"] as String), address: jsonObject["address"] as String, label: jsonObject["label"] as String, + other: jsonObject["other"] as String?, ); } @@ -38,6 +43,7 @@ class ContactAddressEntry { "label": label, "address": address, "coin": coin.name, + "other": other ?? "", }; } diff --git a/lib/pages/address_book_views/address_book_view.dart b/lib/pages/address_book_views/address_book_view.dart index 4b7faaaeb..3266d5986 100644 --- a/lib/pages/address_book_views/address_book_view.dart +++ b/lib/pages/address_book_views/address_book_view.dart @@ -73,6 +73,7 @@ class _AddressBookViewState extends ConsumerState { coin: manager.coin, address: await manager.currentReceivingAddress, label: "Current Receiving", + other: manager.walletName, ), ); } diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index 25f259c58..f433a85b7 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -208,6 +208,16 @@ class ContactPopUp extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (contact.id == "default") + Text( + e.other!, + style: + STextStyles.itemSubtitle12, + ), + if (contact.id == "default") + const SizedBox( + height: 2, + ), Text( "${e.label} (${e.coin.ticker})", style: STextStyles.itemSubtitle12, From af3c5c896afcc2104840f0e803c9da4372453013 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 16 Sep 2022 07:33:22 -0600 Subject: [PATCH 5/7] add back button to wallet view --- lib/pages/wallet_view/wallet_view.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 72227092f..b06b8627c 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -189,7 +189,7 @@ class _WalletViewState extends ConsumerState { return false; } - void _logout() { + void _logout() async { if (_shouldDisableAutoSyncOnLogOut) { // disable auto sync if it was enabled only when loading wallet ref.read(managerProvider).shouldAutoSync = false; @@ -199,7 +199,7 @@ class _WalletViewState extends ConsumerState { if (ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled && ref.read(prefsChangeNotifierProvider).backupFrequencyType == BackupFrequencyType.afterClosingAWallet) { - ref.read(autoSWBServiceProvider).doBackup(); + unawaited(ref.read(autoSWBServiceProvider).doBackup()); } } @@ -364,7 +364,13 @@ class _WalletViewState extends ConsumerState { onWillPop: _onWillPop, child: Scaffold( appBar: AppBar( - automaticallyImplyLeading: false, + leading: AppBarBackButton( + onPressed: () { + _logout(); + Navigator.of(context).pop(); + }, + ), + titleSpacing: 0, title: Row( children: [ SvgPicture.asset( From 2e2c70f660031e73bda7b94c35f37c7e178db28b Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 18 Sep 2022 08:33:49 -0600 Subject: [PATCH 6/7] hide "Current Receiving" on My Stack (self) contact addresses --- .../address_book_views/subviews/contact_popup.dart | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index f433a85b7..b1a926e33 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -214,14 +214,12 @@ class ContactPopUp extends ConsumerWidget { style: STextStyles.itemSubtitle12, ), - if (contact.id == "default") - const SizedBox( - height: 2, + if (contact.id != "default") + Text( + "${e.label} (${e.coin.ticker})", + style: + STextStyles.itemSubtitle12, ), - Text( - "${e.label} (${e.coin.ticker})", - style: STextStyles.itemSubtitle12, - ), const SizedBox( height: 2, ), From 36be1bfc00121291cc7b056b2ffb11bc133dec69 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Mon, 19 Sep 2022 08:24:53 -0600 Subject: [PATCH 7/7] change build --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0150e5728..bd36d781f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Stack Wallet # 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: 1.4.43+58 +version: 1.4.45+60 environment: sdk: ">=2.17.0 <3.0.0"