mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-19 01:04:43 +00:00
unfocus fields when tapping button
Minor cleanup [skip ci]
This commit is contained in:
parent
1f37f6b756
commit
2fb07dd5d4
2 changed files with 4 additions and 26 deletions
|
@ -1,9 +1,7 @@
|
||||||
import 'package:cw_core/transaction_info.dart';
|
import 'package:cw_core/transaction_info.dart';
|
||||||
import 'package:cw_core/monero_amount_format.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/transaction_direction.dart';
|
||||||
import 'package:cw_core/format_amount.dart';
|
import 'package:cw_core/format_amount.dart';
|
||||||
import 'package:cw_monero/api/transaction_history.dart';
|
|
||||||
|
|
||||||
class MoneroTransactionInfo extends TransactionInfo {
|
class MoneroTransactionInfo extends TransactionInfo {
|
||||||
MoneroTransactionInfo(this.txHash, this.height, this.direction, this.date,
|
MoneroTransactionInfo(this.txHash, this.height, this.direction, this.date,
|
||||||
|
@ -11,29 +9,6 @@ class MoneroTransactionInfo extends TransactionInfo {
|
||||||
this.confirmations) :
|
this.confirmations) :
|
||||||
id = "${txHash}_${amount}_${accountIndex}_${addressIndex}";
|
id = "${txHash}_${amount}_${accountIndex}_${addressIndex}";
|
||||||
|
|
||||||
MoneroTransactionInfo.fromMap(Map<String, Object?> 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 = <String, dynamic>{
|
|
||||||
'key': key,
|
|
||||||
'accountIndex': accountIndex,
|
|
||||||
'addressIndex': addressIndex
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
final String id;
|
final String id;
|
||||||
final String txHash;
|
final String txHash;
|
||||||
final int height;
|
final int height;
|
||||||
|
|
|
@ -91,7 +91,10 @@ class LoadingPrimaryButton extends StatelessWidget {
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 52.0,
|
height: 52.0,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: (isLoading || isDisabled) ? null : onPressed,
|
onPressed: (isLoading || isDisabled) ? null : () {
|
||||||
|
FocusScope.of(context).unfocus();
|
||||||
|
onPressed.call();
|
||||||
|
},
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
|
MaterialStateProperty.all(isDisabled ? color.withOpacity(0.5) : color),
|
||||||
|
|
Loading…
Reference in a new issue