quote requests are paused while the payout amount is being edited
This commit is contained in:
@@ -33,6 +33,7 @@ class _PaymentAmountWidgetState extends State<PaymentAmountWidget> {
|
||||
void dispose() {
|
||||
_focusNode.removeListener(_handleFocusChange);
|
||||
_focusNode.dispose();
|
||||
context.read<PaymentAmountProvider>().setEditing(false);
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -62,11 +63,13 @@ class _PaymentAmountWidgetState extends State<PaymentAmountWidget> {
|
||||
}
|
||||
|
||||
void _handleFocusChange() {
|
||||
if (_focusNode.hasFocus) return;
|
||||
final quotationProvider = context.read<QuotationProvider>();
|
||||
if (quotationProvider.canRequestQuote) {
|
||||
quotationProvider.refreshNow(force: false);
|
||||
final amountProvider = context.read<PaymentAmountProvider>();
|
||||
if (_focusNode.hasFocus) {
|
||||
amountProvider.setEditing(true);
|
||||
return;
|
||||
}
|
||||
|
||||
amountProvider.setEditing(false);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -83,6 +86,7 @@ class _PaymentAmountWidgetState extends State<PaymentAmountWidget> {
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
onChanged: _onChanged,
|
||||
onEditingComplete: () => _focusNode.unfocus(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user