Skip to content

Commit f54f9bf

Browse files
committed
fix custom fee on desktop
1 parent 2d90943 commit f54f9bf

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send_fee_form.dart

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ class _DesktopSendFeeFormState extends ConsumerState<DesktopSendFeeForm> {
5555

5656
bool get isEth => cryptoCurrency is Ethereum;
5757

58-
bool isCustomFee = false;
58+
bool _isCustomFeeValue = false;
59+
bool get _isCustomFee => _isCustomFeeValue;
60+
set _isCustomFee(bool newValue) {
61+
if (_isCustomFeeValue != newValue) {
62+
_isCustomFeeValue = newValue;
63+
widget.onCustomFeeOptionChanged.call(_isCustomFeeValue);
64+
}
65+
}
66+
5967
(FeeRateType, String?, String?)? feeSelectionResult;
6068

6169
@override
@@ -97,12 +105,12 @@ class _DesktopSendFeeFormState extends ConsumerState<DesktopSendFeeForm> {
97105
);
98106

99107
if (feeSelectionResult != null) {
100-
if (isCustomFee &&
108+
if (_isCustomFee &&
101109
feeSelectionResult!.$1 != FeeRateType.custom) {
102-
isCustomFee = false;
103-
} else if (!isCustomFee &&
110+
_isCustomFee = false;
111+
} else if (!_isCustomFee &&
104112
feeSelectionResult!.$1 == FeeRateType.custom) {
105-
isCustomFee = true;
113+
_isCustomFee = true;
106114
}
107115
}
108116

@@ -113,7 +121,7 @@ class _DesktopSendFeeFormState extends ConsumerState<DesktopSendFeeForm> {
113121
),
114122
child: Text(
115123
"Transaction fee"
116-
"${isCustomFee ? "" : " (${isEth ? "max" : "estimated"})"}",
124+
"${_isCustomFee ? "" : " (${isEth ? "max" : "estimated"})"}",
117125
style: STextStyles.desktopTextExtraSmall(context).copyWith(
118126
color:
119127
Theme.of(
@@ -124,7 +132,7 @@ class _DesktopSendFeeFormState extends ConsumerState<DesktopSendFeeForm> {
124132
),
125133
),
126134
const SizedBox(height: 10),
127-
if (!isCustomFee)
135+
if (!_isCustomFee)
128136
Padding(
129137
padding: const EdgeInsets.all(10),
130138
child:
@@ -275,7 +283,7 @@ class _DesktopSendFeeFormState extends ConsumerState<DesktopSendFeeForm> {
275283
],
276284
),
277285
),
278-
if (isCustomFee && isEth)
286+
if (_isCustomFee && isEth)
279287
EthFeeForm(
280288
minGasLimit:
281289
widget.isToken
@@ -284,7 +292,7 @@ class _DesktopSendFeeFormState extends ConsumerState<DesktopSendFeeForm> {
284292
stateChanged:
285293
(value) => widget.onCustomEip1559FeeOptionChanged?.call(value),
286294
),
287-
if (isCustomFee && !isEth)
295+
if (_isCustomFee && !isEth)
288296
Padding(
289297
padding: const EdgeInsets.only(bottom: 12, top: 16),
290298
child: FeeSlider(

0 commit comments

Comments
 (0)