Added quote expiry-aware flows with auto-refresh

This commit is contained in:
Arseni
2025-12-29 18:38:21 +03:00
parent 4aeb06fd31
commit f3ad4c2d4f
14 changed files with 610 additions and 64 deletions

View File

@@ -1,13 +1,19 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pshared/models/payment/wallet.dart';
import 'package:pshared/models/recipient/recipient.dart';
import 'package:pshared/provider/payment/provider.dart';
import 'package:pshared/provider/payment/quotation.dart';
import 'package:pshared/provider/recipient/provider.dart';
import 'package:pweb/pages/dashboard/payouts/form.dart';
import 'package:pweb/models/button_state.dart';
import 'package:pweb/pages/dashboard/payouts/form.dart';
import 'package:pweb/pages/payment_methods/payment_page/back_button.dart';
import 'package:pweb/pages/payment_methods/payment_page/header.dart';
import 'package:pweb/pages/payment_methods/payment_page/method_selector.dart';
import 'package:pweb/pages/payment_methods/payment_page/quote/quote_status.dart';
import 'package:pweb/pages/payment_methods/payment_page/send_button.dart';
import 'package:pweb/pages/payment_methods/widgets/payment_info_section.dart';
import 'package:pweb/pages/payment_methods/widgets/recipient_section.dart';
@@ -94,8 +100,21 @@ class PaymentPageContent extends StatelessWidget {
PaymentInfoSection(dimensions: dimensions),
SizedBox(height: dimensions.paddingLarge),
const PaymentFormWidget(),
SizedBox(height: dimensions.paddingXXXLarge),
SendButton(onPressed: onSend),
SizedBox(height: dimensions.paddingLarge),
const QuoteStatus(),
SizedBox(height: dimensions.paddingXXLarge),
Consumer2<QuotationProvider, PaymentProvider>(
builder: (context, quotation, payment, _) {
final canSend = quotation.hasLiveQuote && !payment.isLoading;
final state = payment.isLoading
? ButtonState.loading
: (canSend ? ButtonState.enabled : ButtonState.disabled);
return SendButton(
onPressed: canSend ? onSend : null,
state: state,
);
},
),
SizedBox(height: dimensions.paddingLarge),
],
),