mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-05 12:44:09 +01:00
Flutter upgrade
This commit is contained in:
@@ -14,21 +14,19 @@ class UnspentCoinsDetailsViewModel = UnspentCoinsDetailsViewModelBase
|
||||
|
||||
abstract class UnspentCoinsDetailsViewModelBase with Store {
|
||||
UnspentCoinsDetailsViewModelBase({
|
||||
this.unspentCoinsItem, this.unspentCoinsListViewModel}) {
|
||||
|
||||
final amount = unspentCoinsItem.amount ?? '';
|
||||
final address = unspentCoinsItem.address ?? '';
|
||||
isFrozen = unspentCoinsItem.isFrozen ?? false;
|
||||
note = unspentCoinsItem.note ?? '';
|
||||
|
||||
required this.unspentCoinsItem,
|
||||
required this.unspentCoinsListViewModel})
|
||||
: items = <TransactionDetailsListItem>[],
|
||||
isFrozen = unspentCoinsItem.isFrozen,
|
||||
note = unspentCoinsItem.note {
|
||||
items = [
|
||||
StandartListItem(
|
||||
title: S.current.transaction_details_amount,
|
||||
value: amount
|
||||
value: unspentCoinsItem.amount
|
||||
),
|
||||
StandartListItem(
|
||||
title: S.current.widgets_address,
|
||||
value: address
|
||||
value: unspentCoinsItem.address
|
||||
),
|
||||
TextFieldListItem(
|
||||
title: S.current.note_tap_to_change,
|
||||
|
||||
@@ -6,12 +6,12 @@ class UnspentCoinsItem = UnspentCoinsItemBase with _$UnspentCoinsItem;
|
||||
|
||||
abstract class UnspentCoinsItemBase with Store {
|
||||
UnspentCoinsItemBase({
|
||||
this.address,
|
||||
this.amount,
|
||||
this.hash,
|
||||
this.isFrozen,
|
||||
this.note,
|
||||
this.isSending});
|
||||
required this.address,
|
||||
required this.amount,
|
||||
required this.hash,
|
||||
required this.isFrozen,
|
||||
required this.note,
|
||||
required this.isSending});
|
||||
|
||||
@observable
|
||||
String address;
|
||||
|
||||
@@ -14,18 +14,18 @@ class UnspentCoinsListViewModel = UnspentCoinsListViewModelBase with _$UnspentCo
|
||||
|
||||
abstract class UnspentCoinsListViewModelBase with Store {
|
||||
UnspentCoinsListViewModelBase({
|
||||
@required this.wallet,
|
||||
@required Box<UnspentCoinsInfo> unspentCoinsInfo}) {
|
||||
_unspentCoinsInfo = unspentCoinsInfo;
|
||||
bitcoin.updateUnspents(wallet);
|
||||
required this.wallet,
|
||||
required Box<UnspentCoinsInfo> unspentCoinsInfo})
|
||||
: _unspentCoinsInfo = unspentCoinsInfo {
|
||||
bitcoin!.updateUnspents(wallet);
|
||||
}
|
||||
|
||||
WalletBase wallet;
|
||||
Box<UnspentCoinsInfo> _unspentCoinsInfo;
|
||||
|
||||
@computed
|
||||
ObservableList<UnspentCoinsItem> get items => ObservableList.of(bitcoin.getUnspents(wallet).map((elem) {
|
||||
final amount = bitcoin.formatterBitcoinAmountToString(amount: elem.value) +
|
||||
ObservableList<UnspentCoinsItem> get items => ObservableList.of(bitcoin!.getUnspents(wallet).map((elem) {
|
||||
final amount = bitcoin!.formatterBitcoinAmountToString(amount: elem.value) +
|
||||
' ${wallet.currency.title}';
|
||||
|
||||
final info = _unspentCoinsInfo.values
|
||||
@@ -52,7 +52,7 @@ abstract class UnspentCoinsListViewModelBase with Store {
|
||||
info.note = item.note;
|
||||
|
||||
await info.save();
|
||||
bitcoin.updateUnspents(wallet);
|
||||
bitcoin!.updateUnspents(wallet);
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'package:cake_wallet/src/screens/transaction_details/transaction_details_
|
||||
|
||||
class UnspentCoinsSwitchItem extends TransactionDetailsListItem {
|
||||
UnspentCoinsSwitchItem({
|
||||
String title,
|
||||
String value,
|
||||
this.switchValue,
|
||||
this.onSwitchValueChange}) : super(title: title, value: value);
|
||||
required String title,
|
||||
required String value,
|
||||
required this.switchValue,
|
||||
required this.onSwitchValueChange}) : super(title: title, value: value);
|
||||
|
||||
final bool Function() switchValue;
|
||||
final void Function(bool value) onSwitchValueChange;
|
||||
|
||||
Reference in New Issue
Block a user