Skip to content

Commit 41ade11

Browse files
authored
Merge pull request #69 from cypherstack/staging
Staging
2 parents 53f3a99 + 6ae19d6 commit 41ade11

File tree

8 files changed

+78
-51
lines changed

8 files changed

+78
-51
lines changed

lib/models/contact_address_entry.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@ class ContactAddressEntry {
66
final Coin coin;
77
final String address;
88
final String label;
9+
final String? other;
910

1011
const ContactAddressEntry({
1112
required this.coin,
1213
required this.address,
1314
required this.label,
15+
this.other,
1416
});
1517

1618
ContactAddressEntry copyWith({
1719
Coin? coin,
1820
String? address,
1921
String? label,
22+
String? other,
2023
}) {
2124
return ContactAddressEntry(
2225
coin: coin ?? this.coin,
2326
address: address ?? this.address,
2427
label: label ?? this.label,
28+
other: other ?? this.other,
2529
);
2630
}
2731

@@ -30,6 +34,7 @@ class ContactAddressEntry {
3034
coin: Coin.values.byName(jsonObject["coin"] as String),
3135
address: jsonObject["address"] as String,
3236
label: jsonObject["label"] as String,
37+
other: jsonObject["other"] as String?,
3338
);
3439
}
3540

@@ -38,6 +43,7 @@ class ContactAddressEntry {
3843
"label": label,
3944
"address": address,
4045
"coin": coin.name,
46+
"other": other ?? "",
4147
};
4248
}
4349

lib/pages/address_book_views/address_book_view.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
7373
coin: manager.coin,
7474
address: await manager.currentReceivingAddress,
7575
label: "Current Receiving",
76+
other: manager.walletName,
7677
),
7778
);
7879
}

lib/pages/address_book_views/subviews/contact_popup.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,18 @@ class ContactPopUp extends ConsumerWidget {
208208
crossAxisAlignment:
209209
CrossAxisAlignment.start,
210210
children: [
211-
Text(
212-
"${e.label} (${e.coin.ticker})",
213-
style: STextStyles.itemSubtitle12,
214-
),
211+
if (contact.id == "default")
212+
Text(
213+
e.other!,
214+
style:
215+
STextStyles.itemSubtitle12,
216+
),
217+
if (contact.id != "default")
218+
Text(
219+
"${e.label} (${e.coin.ticker})",
220+
style:
221+
STextStyles.itemSubtitle12,
222+
),
215223
const SizedBox(
216224
height: 2,
217225
),

lib/pages/wallet_view/wallet_view.dart

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
189189
return false;
190190
}
191191

192-
void _logout() {
192+
void _logout() async {
193193
if (_shouldDisableAutoSyncOnLogOut) {
194194
// disable auto sync if it was enabled only when loading wallet
195195
ref.read(managerProvider).shouldAutoSync = false;
@@ -199,7 +199,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
199199
if (ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled &&
200200
ref.read(prefsChangeNotifierProvider).backupFrequencyType ==
201201
BackupFrequencyType.afterClosingAWallet) {
202-
ref.read(autoSWBServiceProvider).doBackup();
202+
unawaited(ref.read(autoSWBServiceProvider).doBackup());
203203
}
204204
}
205205

@@ -364,7 +364,13 @@ class _WalletViewState extends ConsumerState<WalletView> {
364364
onWillPop: _onWillPop,
365365
child: Scaffold(
366366
appBar: AppBar(
367-
automaticallyImplyLeading: false,
367+
leading: AppBarBackButton(
368+
onPressed: () {
369+
_logout();
370+
Navigator.of(context).pop();
371+
},
372+
),
373+
titleSpacing: 0,
368374
title: Row(
369375
children: [
370376
SvgPicture.asset(
@@ -376,9 +382,13 @@ class _WalletViewState extends ConsumerState<WalletView> {
376382
const SizedBox(
377383
width: 16,
378384
),
379-
Text(
380-
ref.watch(managerProvider.select((value) => value.walletName)),
381-
style: STextStyles.navBarTitle,
385+
Expanded(
386+
child: Text(
387+
ref.watch(
388+
managerProvider.select((value) => value.walletName)),
389+
style: STextStyles.navBarTitle,
390+
overflow: TextOverflow.ellipsis,
391+
),
382392
)
383393
],
384394
),

lib/services/coins/bitcoin/bitcoin_wallet.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import 'package:stackwallet/utilities/prefs.dart';
4242
import 'package:tuple/tuple.dart';
4343
import 'package:uuid/uuid.dart';
4444

45-
const int MINIMUM_CONFIRMATIONS = 2;
45+
const int MINIMUM_CONFIRMATIONS = 1;
4646
const int DUST_LIMIT = 294;
4747

4848
const String GENESIS_HASH_MAINNET =

lib/widgets/wallet_card.dart

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -79,44 +79,46 @@ class WalletSheetCard extends ConsumerWidget {
7979
const SizedBox(
8080
width: 12,
8181
),
82-
Column(
83-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
84-
crossAxisAlignment: CrossAxisAlignment.start,
85-
children: [
86-
Text(
87-
manager.walletName,
88-
style: STextStyles.titleBold12,
89-
),
90-
const SizedBox(
91-
height: 2,
92-
),
93-
FutureBuilder(
94-
future: manager.totalBalance,
95-
builder: (builderContext, AsyncSnapshot<Decimal> snapshot) {
96-
if (snapshot.connectionState == ConnectionState.done &&
97-
snapshot.hasData) {
98-
return Text(
99-
"${Format.localizedStringAsFixed(
100-
value: snapshot.data!,
101-
locale: locale,
102-
decimalPlaces: 8,
103-
)} ${coin.ticker}",
104-
style: STextStyles.itemSubtitle,
105-
);
106-
} else {
107-
return AnimatedText(
108-
stringsToLoopThrough: const [
109-
"Loading balance",
110-
"Loading balance.",
111-
"Loading balance..",
112-
"Loading balance..."
113-
],
114-
style: STextStyles.itemSubtitle,
115-
);
116-
}
117-
},
118-
),
119-
],
82+
Expanded(
83+
child: Column(
84+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
85+
crossAxisAlignment: CrossAxisAlignment.start,
86+
children: [
87+
Text(
88+
manager.walletName,
89+
style: STextStyles.titleBold12,
90+
),
91+
const SizedBox(
92+
height: 2,
93+
),
94+
FutureBuilder(
95+
future: manager.totalBalance,
96+
builder: (builderContext, AsyncSnapshot<Decimal> snapshot) {
97+
if (snapshot.connectionState == ConnectionState.done &&
98+
snapshot.hasData) {
99+
return Text(
100+
"${Format.localizedStringAsFixed(
101+
value: snapshot.data!,
102+
locale: locale,
103+
decimalPlaces: 8,
104+
)} ${coin.ticker}",
105+
style: STextStyles.itemSubtitle,
106+
);
107+
} else {
108+
return AnimatedText(
109+
stringsToLoopThrough: const [
110+
"Loading balance",
111+
"Loading balance.",
112+
"Loading balance..",
113+
"Loading balance..."
114+
],
115+
style: STextStyles.itemSubtitle,
116+
);
117+
}
118+
},
119+
),
120+
],
121+
),
120122
),
121123
],
122124
),

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: Stack Wallet
1111
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1212
# Read more about iOS versioning at
1313
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14-
version: 1.4.43+58
14+
version: 1.4.45+60
1515

1616
environment:
1717
sdk: ">=2.17.0 <3.0.0"

test/services/coins/bitcoin/bitcoin_wallet_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import 'bitcoin_wallet_test_parameters.dart';
2828
void main() {
2929
group("bitcoin constants", () {
3030
test("bitcoin minimum confirmations", () async {
31-
expect(MINIMUM_CONFIRMATIONS, 2);
31+
expect(MINIMUM_CONFIRMATIONS, 1);
3232
});
3333
test("bitcoin dust limit", () async {
3434
expect(DUST_LIMIT, 294);

0 commit comments

Comments
 (0)