mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
Back next address button on receive screen
This commit is contained in:
parent
3b70cc91fe
commit
91ed52003b
3 changed files with 24 additions and 13 deletions
|
@ -239,7 +239,7 @@ abstract class ElectrumWalletBase extends WalletBase<ElectrumBalance,
|
|||
}
|
||||
|
||||
final txb = bitcoin.TransactionBuilder(network: networkType);
|
||||
final changeAddress = getChangeAddress();
|
||||
final changeAddress = walletAddresses.addresses.last.address;
|
||||
var leftAmount = totalAmount;
|
||||
var totalInputAmount = 0;
|
||||
|
||||
|
|
|
@ -35,24 +35,35 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
|
|||
|
||||
ObservableList<BitcoinAddressRecord> addresses;
|
||||
|
||||
List<BitcoinAddressRecord> get availableAddresses => addresses
|
||||
.where((addr) => addr.isHidden)
|
||||
.toList();
|
||||
|
||||
int accountIndex;
|
||||
|
||||
@override
|
||||
Future<void> init() async {
|
||||
await generateAddresses();
|
||||
address = addresses[accountIndex].address;
|
||||
final _availableAddresses = availableAddresses;
|
||||
|
||||
if (accountIndex >= _availableAddresses.length) {
|
||||
accountIndex = 0;
|
||||
}
|
||||
|
||||
address = _availableAddresses[accountIndex].address;
|
||||
await updateAddressesInBox();
|
||||
}
|
||||
|
||||
@action
|
||||
Future<void> nextAddress() async {
|
||||
accountIndex += 1;
|
||||
final _availableAddresses = availableAddresses;
|
||||
|
||||
if (accountIndex >= addresses.length) {
|
||||
if (accountIndex >= _availableAddresses.length) {
|
||||
accountIndex = 0;
|
||||
}
|
||||
|
||||
address = addresses[accountIndex].address;
|
||||
address = _availableAddresses[accountIndex].address;
|
||||
|
||||
await updateAddressesInBox();
|
||||
}
|
||||
|
|
|
@ -125,15 +125,15 @@ class AddressPage extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
) : Container();
|
||||
//: PrimaryButton(
|
||||
// onPressed: () => addressListViewModel.nextAddress(),
|
||||
// text: 'Next address',
|
||||
// color: Theme.of(context).buttonColor,
|
||||
// textColor: Theme.of(context)
|
||||
// .accentTextTheme
|
||||
// .display3
|
||||
// .backgroundColor);
|
||||
)
|
||||
: PrimaryButton(
|
||||
onPressed: () => addressListViewModel.nextAddress(),
|
||||
text: 'Next address',
|
||||
color: Theme.of(context).buttonColor,
|
||||
textColor: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.display3
|
||||
.backgroundColor);
|
||||
})
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue