unfocus fields when tapping button Minor cleanup [skip ci]

unfocus fields when tapping button Minor cleanup [skip ci]

OmarHatem committed Jan 17, 2025 at 16:31 UTC 2fb07dd5d491bb9a220141420fa8ecb8eee2edbc
2 files changed +4 -26
cw_monero/lib/monero_transaction_info.dart
-25
@@ -1,9 +1,7 @@
1 import 'package:cw_core/transaction_info.dart';
2 import 'package:cw_core/monero_amount_format.dart';
3 -import 'package:cw_core/parseBoolFromString.dart';
3 import 'package:cw_core/transaction_direction.dart';
4 import 'package:cw_core/format_amount.dart';
6 -import 'package:cw_monero/api/transaction_history.dart';
5
6 class MoneroTransactionInfo extends TransactionInfo {
7 MoneroTransactionInfo(this.txHash, this.height, this.direction, this.date,
@@ -11,29 +9,6 @@ class MoneroTransactionInfo extends TransactionInfo {
9 this.confirmations) :
10 id = "${txHash}_${amount}_${accountIndex}_${addressIndex}";
11
14 - MoneroTransactionInfo.fromMap(Map<String, Object?> map)
15 - : id = "${map['hash']}_${map['amount']}_${map['accountIndex']}_${map['addressIndex']}",
16 - txHash = map['hash'] as String,
17 - height = (map['height'] ?? 0) as int,
18 - direction = map['direction'] != null
19 - ? parseTransactionDirectionFromNumber(map['direction'] as String)
20 - : TransactionDirection.incoming,
21 - date = DateTime.fromMillisecondsSinceEpoch(
22 - (int.tryParse(map['timestamp'] as String? ?? '') ?? 0) * 1000),
23 - isPending = parseBoolFromString(map['isPending'] as String),
24 - amount = map['amount'] as int,
25 - accountIndex = int.parse(map['accountIndex'] as String),
26 - addressIndex = map['addressIndex'] as int,
27 - confirmations = map['confirmations'] as int,
28 - key = getTxKey((map['hash'] ?? '') as String),
29 - fee = map['fee'] as int? ?? 0 {
30 - additionalInfo = <String, dynamic>{
31 - 'key': key,
32 - 'accountIndex': accountIndex,
33 - 'addressIndex': addressIndex
34 - };
35 - }
36 -
12 final String id;
13 final String txHash;
14 final int height;
lib/src/widgets/primary_button.dart
+4 -1
@@ -91,7 +91,10 @@ class LoadingPrimaryButton extends StatelessWidget {
91 width: double.infinity,
92 height: 52.0,
93 child: TextButton(
94 - onPressed: (isLoading || isDisabled) ? null : onPressed,
94 + onPressed: (isLoading || isDisabled) ? null : () {
95 + FocusScope.of(context).unfocus();
96 + onPressed.call();
97 + },
98 style: ButtonStyle(
99 backgroundColor:
100 MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),