Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/models/contact_address_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}

Expand All @@ -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?,
);
}

Expand All @@ -38,6 +43,7 @@ class ContactAddressEntry {
"label": label,
"address": address,
"coin": coin.name,
"other": other ?? "",
};
}

Expand Down
1 change: 1 addition & 0 deletions lib/pages/address_book_views/address_book_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
coin: manager.coin,
address: await manager.currentReceivingAddress,
label: "Current Receiving",
other: manager.walletName,
),
);
}
Expand Down
16 changes: 12 additions & 4 deletions lib/pages/address_book_views/subviews/contact_popup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,18 @@ class ContactPopUp extends ConsumerWidget {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"${e.label} (${e.coin.ticker})",
style: STextStyles.itemSubtitle12,
),
if (contact.id == "default")
Text(
e.other!,
style:
STextStyles.itemSubtitle12,
),
if (contact.id != "default")
Text(
"${e.label} (${e.coin.ticker})",
style:
STextStyles.itemSubtitle12,
),
const SizedBox(
height: 2,
),
Expand Down
22 changes: 16 additions & 6 deletions lib/pages/wallet_view/wallet_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
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;
Expand All @@ -199,7 +199,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
if (ref.read(prefsChangeNotifierProvider).isAutoBackupEnabled &&
ref.read(prefsChangeNotifierProvider).backupFrequencyType ==
BackupFrequencyType.afterClosingAWallet) {
ref.read(autoSWBServiceProvider).doBackup();
unawaited(ref.read(autoSWBServiceProvider).doBackup());
}
}

Expand Down Expand Up @@ -364,7 +364,13 @@ class _WalletViewState extends ConsumerState<WalletView> {
onWillPop: _onWillPop,
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
leading: AppBarBackButton(
onPressed: () {
_logout();
Navigator.of(context).pop();
},
),
titleSpacing: 0,
title: Row(
children: [
SvgPicture.asset(
Expand All @@ -376,9 +382,13 @@ class _WalletViewState extends ConsumerState<WalletView> {
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,
),
)
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/services/coins/bitcoin/bitcoin_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
78 changes: 40 additions & 38 deletions lib/widgets/wallet_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Decimal> 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<Decimal> 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,
);
}
},
),
],
),
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/services/coins/bitcoin/bitcoin_wallet_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down