Skip to content

Commit 2a61446

Browse files
committed
format modified Dart files
1 parent f8b680c commit 2a61446

6 files changed

Lines changed: 299 additions & 297 deletions

File tree

lib/pages/masternodes/masternodes_home_view.dart

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class _MasternodesHomeViewState extends ConsumerState<MasternodesHomeView> {
4242
bool _isCheckingForCollateral = false;
4343

4444
Set<String> _dismissedCollateral(FiroWallet wallet) {
45-
final raw = wallet.info.otherData[WalletInfoKeys.firoMasternodeCollateralDismissed];
45+
final raw =
46+
wallet.info.otherData[WalletInfoKeys.firoMasternodeCollateralDismissed];
4647
if (raw is! List) {
4748
return {};
4849
}
@@ -64,10 +65,9 @@ class _MasternodesHomeViewState extends ConsumerState<MasternodesHomeView> {
6465
);
6566
}
6667

67-
Future<({String txid, int vout, String address})?> _findCollateralUtxo()
68-
async {
69-
final wallet =
70-
ref.read(pWallets).getWallet(widget.walletId) as FiroWallet;
68+
Future<({String txid, int vout, String address})?>
69+
_findCollateralUtxo() async {
70+
final wallet = ref.read(pWallets).getWallet(widget.walletId) as FiroWallet;
7171
final List<UTXO> utxos =
7272
await (wallet.mainDB.getUTXOs(widget.walletId) as dynamic).findAll()
7373
as List<UTXO>;
@@ -157,7 +157,8 @@ class _MasternodesHomeViewState extends ConsumerState<MasternodesHomeView> {
157157
return;
158158
}
159159

160-
final wallet = ref.read(pWallets).getWallet(widget.walletId) as FiroWallet;
160+
final wallet =
161+
ref.read(pWallets).getWallet(widget.walletId) as FiroWallet;
161162
final dismissed = _dismissedCollateral(wallet);
162163
final collateralKey = "${collateral.txid}:${collateral.vout}";
163164
if (dismissed.contains(collateralKey)) {
@@ -175,27 +176,22 @@ class _MasternodesHomeViewState extends ConsumerState<MasternodesHomeView> {
175176
"A 1000 FIRO collateral UTXO was found in your wallet. "
176177
"Would you like to register a masternode now?",
177178
leftButton: TextButton(
178-
style: Theme.of(ctx)
179-
.extension<StackColors>()!
180-
.getSecondaryEnabledButtonStyle(ctx),
179+
style: Theme.of(
180+
ctx,
181+
).extension<StackColors>()!.getSecondaryEnabledButtonStyle(ctx),
181182
child: Text(
182183
"Later",
183-
style: STextStyles.button(
184-
ctx,
185-
).copyWith(
184+
style: STextStyles.button(ctx).copyWith(
186185
color: Theme.of(ctx).extension<StackColors>()!.accentColorDark,
187186
),
188187
),
189188
onPressed: () => Navigator.of(ctx).pop(false),
190189
),
191190
rightButton: TextButton(
192-
style: Theme.of(ctx)
193-
.extension<StackColors>()!
194-
.getPrimaryEnabledButtonStyle(ctx),
195-
child: Text(
196-
"Register",
197-
style: STextStyles.button(ctx),
198-
),
191+
style: Theme.of(
192+
ctx,
193+
).extension<StackColors>()!.getPrimaryEnabledButtonStyle(ctx),
194+
child: Text("Register", style: STextStyles.button(ctx)),
199195
onPressed: () => Navigator.of(ctx).pop(true),
200196
),
201197
),

lib/pages/masternodes/sub_widgets/register_masternode_form.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ class _RegisterMasternodeFormState
188188
children: [
189189
Text(
190190
"Masternode collateral",
191-
style: STextStyles.w500_12(context).copyWith(
192-
color: stack.textSubtitle1,
193-
),
191+
style: STextStyles.w500_12(
192+
context,
193+
).copyWith(color: stack.textSubtitle1),
194194
),
195195
const SizedBox(height: 4),
196196
SelectableText(
@@ -202,9 +202,9 @@ class _RegisterMasternodeFormState
202202
const SizedBox(height: 4),
203203
SelectableText(
204204
"${widget.collateralTxid}:${widget.collateralVout}",
205-
style: STextStyles.w500_12(context).copyWith(
206-
color: stack.textSubtitle1,
207-
),
205+
style: STextStyles.w500_12(
206+
context,
207+
).copyWith(color: stack.textSubtitle1),
208208
),
209209
],
210210
),

lib/pages/send_view/confirm_transaction_view.dart

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,7 @@ class _ConfirmTransactionViewState
360360
final recipientAddresses = <String>{};
361361
final addresses = scriptPubKey['addresses'];
362362
if (addresses is List) {
363-
recipientAddresses.addAll(
364-
addresses.whereType<String>(),
365-
);
363+
recipientAddresses.addAll(addresses.whereType<String>());
366364
}
367365

368366
final address = scriptPubKey['address'];
@@ -577,13 +575,12 @@ class _ConfirmTransactionViewState
577575
.firstOrNull;
578576

579577
if (mnRecipient != null && confirmedTx.txid != null) {
580-
final ownAddress =
581-
await ref
582-
.read(mainDBProvider)
583-
.getAddresses(walletId)
584-
.filter()
585-
.valueEqualTo(mnRecipient.address)
586-
.findFirst();
578+
final ownAddress = await ref
579+
.read(mainDBProvider)
580+
.getAddresses(walletId)
581+
.filter()
582+
.valueEqualTo(mnRecipient.address)
583+
.findFirst();
587584

588585
if (ownAddress != null && context.mounted) {
589586
final collateralVout = await _resolveFiroCollateralVout(
@@ -614,9 +611,9 @@ class _ConfirmTransactionViewState
614611
void completeMnParentNavigation() {
615612
if (widget.onSuccessInsteadOfRouteOnSuccess == null) {
616613
if (isDesktop) {
617-
Navigator.of(context).popUntil(
618-
ModalRoute.withName(routeOnSuccessName),
619-
);
614+
Navigator.of(
615+
context,
616+
).popUntil(ModalRoute.withName(routeOnSuccessName));
620617
} else {
621618
final navigator = Navigator.of(context);
622619
navigator.popUntil(
@@ -654,25 +651,27 @@ class _ConfirmTransactionViewState
654651
} else {
655652
final navContext =
656653
(rootContext != null && rootContext.mounted)
657-
? rootContext
658-
: context;
654+
? rootContext
655+
: context;
659656
if (!navContext.mounted) {
660657
return;
661658
}
662659
unawaited(
663-
Navigator.of(navContext).pushNamed(
664-
CreateMasternodeView.routeName,
665-
arguments: {
666-
'walletId': walletId,
667-
'collateralTxid': confirmedTx.txid!,
668-
'collateralVout': collateralVout,
669-
'collateralAddress': mnRecipient.address,
670-
},
671-
).then((result) {
672-
if (result is String) {
673-
_showMasternodeSubmittedDialog(rootContext, result);
674-
}
675-
}),
660+
Navigator.of(navContext)
661+
.pushNamed(
662+
CreateMasternodeView.routeName,
663+
arguments: {
664+
'walletId': walletId,
665+
'collateralTxid': confirmedTx.txid!,
666+
'collateralVout': collateralVout,
667+
'collateralAddress': mnRecipient.address,
668+
},
669+
)
670+
.then((result) {
671+
if (result is String) {
672+
_showMasternodeSubmittedDialog(rootContext, result);
673+
}
674+
}),
676675
);
677676
}
678677
}
@@ -693,20 +692,24 @@ class _ConfirmTransactionViewState
693692
} else {
694693
// If fee was subtracted from the recipient, users can enter 1000 but
695694
// end up with ~999.99... output which is not valid MN collateral.
696-
final nearMnRecipient = confirmedTx.recipients!
697-
.where((r) => !r.isChange && r.amount.raw < masternodeAmount.raw)
698-
.where((r) => (masternodeAmount.raw - r.amount.raw) <= txFeeRaw)
699-
.toList()
700-
..sort((a, b) => b.amount.raw.compareTo(a.amount.raw));
695+
final nearMnRecipient =
696+
confirmedTx.recipients!
697+
.where(
698+
(r) => !r.isChange && r.amount.raw < masternodeAmount.raw,
699+
)
700+
.where(
701+
(r) => (masternodeAmount.raw - r.amount.raw) <= txFeeRaw,
702+
)
703+
.toList()
704+
..sort((a, b) => b.amount.raw.compareTo(a.amount.raw));
701705

702706
if (nearMnRecipient.isNotEmpty) {
703-
final maybeOwnAddress =
704-
await ref
705-
.read(mainDBProvider)
706-
.getAddresses(walletId)
707-
.filter()
708-
.valueEqualTo(nearMnRecipient.first.address)
709-
.findFirst();
707+
final maybeOwnAddress = await ref
708+
.read(mainDBProvider)
709+
.getAddresses(walletId)
710+
.filter()
711+
.valueEqualTo(nearMnRecipient.first.address)
712+
.findFirst();
710713

711714
if (maybeOwnAddress != null && context.mounted) {
712715
unawaited(

0 commit comments

Comments
 (0)