mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 12:29:31 +00:00
transaction view model refactoring
This commit is contained in:
parent
2103aa06bf
commit
3fc1263ad4
5 changed files with 6 additions and 6 deletions
|
@ -41,4 +41,5 @@ class TransactionInfoRow extends Struct {
|
||||||
bool getIsPending() => isPending != 0;
|
bool getIsPending() => isPending != 0;
|
||||||
String getHash() => hash.toDartString();
|
String getHash() => hash.toDartString();
|
||||||
String getPaymentId() => paymentId.toDartString();
|
String getPaymentId() => paymentId.toDartString();
|
||||||
|
int getUnlockTime() => unlockTime * 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class MoneroTransactionInfo extends TransactionInfo {
|
||||||
amount = row.getAmount(),
|
amount = row.getAmount(),
|
||||||
accountIndex = row.subaddrAccount,
|
accountIndex = row.subaddrAccount,
|
||||||
addressIndex = row.subaddrIndex,
|
addressIndex = row.subaddrIndex,
|
||||||
unlockTime = row.unlockTime,
|
unlockTime = row.getUnlockTime(),
|
||||||
key = getTxKey(row.getHash()),
|
key = getTxKey(row.getHash()),
|
||||||
fee = row.fee {
|
fee = row.fee {
|
||||||
additionalInfo = <String, dynamic>{
|
additionalInfo = <String, dynamic>{
|
||||||
|
@ -59,14 +59,13 @@ class MoneroTransactionInfo extends TransactionInfo {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String? unlockTimeFormatted() {
|
String? unlockTimeFormatted() {
|
||||||
final formattedTime = unlockTime * 2;
|
|
||||||
if (direction == TransactionDirection.outgoing || unlockTime == 0) {
|
if (direction == TransactionDirection.outgoing || unlockTime == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formattedTime > 500000) {
|
if (unlockTime > 500000) {
|
||||||
return '>1 year';
|
return '>1 year';
|
||||||
}
|
}
|
||||||
return '~ $formattedTime minutes';
|
return '~ $unlockTime minutes';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ import 'package:cake_wallet/view_model/restore_from_backup_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
|
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/setup_pin_code_view_model.dart';
|
import 'package:cake_wallet/view_model/setup_pin_code_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/support_view_model.dart';
|
import 'package:cake_wallet/view_model/support_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/transaction_details_view_model.dart';
|
import 'package:cake_wallet/view_model/transactions/transaction_details_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/trade_details_view_model.dart';
|
import 'package:cake_wallet/view_model/trade_details_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_details_view_model.dart';
|
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_details_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_item.dart';
|
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_item.dart';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import 'package:cake_wallet/src/screens/transaction_details/textfield_list_item.
|
||||||
import 'package:cake_wallet/src/screens/transaction_details/widgets/textfield_list_row.dart';
|
import 'package:cake_wallet/src/screens/transaction_details/widgets/textfield_list_row.dart';
|
||||||
import 'package:cake_wallet/src/widgets/standard_list.dart';
|
import 'package:cake_wallet/src/widgets/standard_list.dart';
|
||||||
import 'package:cake_wallet/utils/show_bar.dart';
|
import 'package:cake_wallet/utils/show_bar.dart';
|
||||||
import 'package:cake_wallet/view_model/transaction_details_view_model.dart';
|
import 'package:cake_wallet/view_model/transactions/transaction_details_view_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
Loading…
Reference in a new issue