diff --git a/cw_monero/lib/monero_transaction_info.dart b/cw_monero/lib/monero_transaction_info.dart index 76064ad11..0ac48dcba 100644 --- a/cw_monero/lib/monero_transaction_info.dart +++ b/cw_monero/lib/monero_transaction_info.dart @@ -1,9 +1,7 @@ import 'package:cw_core/transaction_info.dart'; import 'package:cw_core/monero_amount_format.dart'; -import 'package:cw_core/parseBoolFromString.dart'; import 'package:cw_core/transaction_direction.dart'; import 'package:cw_core/format_amount.dart'; -import 'package:cw_monero/api/transaction_history.dart'; class MoneroTransactionInfo extends TransactionInfo { MoneroTransactionInfo(this.txHash, this.height, this.direction, this.date, @@ -11,29 +9,6 @@ class MoneroTransactionInfo extends TransactionInfo { this.confirmations) : id = "${txHash}_${amount}_${accountIndex}_${addressIndex}"; - MoneroTransactionInfo.fromMap(Map map) - : id = "${map['hash']}_${map['amount']}_${map['accountIndex']}_${map['addressIndex']}", - txHash = map['hash'] as String, - height = (map['height'] ?? 0) as int, - direction = map['direction'] != null - ? parseTransactionDirectionFromNumber(map['direction'] as String) - : TransactionDirection.incoming, - date = DateTime.fromMillisecondsSinceEpoch( - (int.tryParse(map['timestamp'] as String? ?? '') ?? 0) * 1000), - isPending = parseBoolFromString(map['isPending'] as String), - amount = map['amount'] as int, - accountIndex = int.parse(map['accountIndex'] as String), - addressIndex = map['addressIndex'] as int, - confirmations = map['confirmations'] as int, - key = getTxKey((map['hash'] ?? '') as String), - fee = map['fee'] as int? ?? 0 { - additionalInfo = { - 'key': key, - 'accountIndex': accountIndex, - 'addressIndex': addressIndex - }; - } - final String id; final String txHash; final int height; diff --git a/lib/src/widgets/primary_button.dart b/lib/src/widgets/primary_button.dart index 06bfda157..d5800aa5b 100644 --- a/lib/src/widgets/primary_button.dart +++ b/lib/src/widgets/primary_button.dart @@ -91,7 +91,10 @@ class LoadingPrimaryButton extends StatelessWidget { width: double.infinity, height: 52.0, child: TextButton( - onPressed: (isLoading || isDisabled) ? null : onPressed, + onPressed: (isLoading || isDisabled) ? null : () { + FocusScope.of(context).unfocus(); + onPressed.call(); + }, style: ButtonStyle( backgroundColor: MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),