usability fixes

This commit is contained in:
2026-06-01 20:49:53 +02:00
parent 7b5b962fe6
commit 1d8ab2088c
6 changed files with 167 additions and 38 deletions

View File

@@ -73,7 +73,9 @@ class PayController extends ChangeNotifier {
// formData can come from a repeat transaction
// otherwise build it from elements of the normal flow
Future<ApiResponse<Map<String, dynamic>>> doTransaction([tc.FormData? formData]) async {
Future<ApiResponse<Map<String, dynamic>>> doTransaction([
tc.FormData? formData,
]) async {
try {
model.isLoading = true;
notifyListeners();
@@ -129,7 +131,9 @@ class PayController extends ChangeNotifier {
logger.e(s);
model.isLoading = false;
notifyListeners();
return ApiResponse.failure("Network error. Please try again or contact support");
return ApiResponse.failure(
"Network error. Please try again or contact support",
);
} catch (e, s) {
logger.e(s);
model.isLoading = false;
@@ -170,8 +174,9 @@ class PayController extends ChangeNotifier {
notifyListeners();
List<dynamic> response = await http.get('/public/payment-processors');
model.paymentProcessors =
response.map((e) => PaymentProcessor.fromJson(e)).toList();
model.paymentProcessors = response
.map((e) => PaymentProcessor.fromJson(e))
.toList();
model.isLoading = false;
notifyListeners();

View File

@@ -65,7 +65,7 @@ class _PayScreenState extends State<PayScreen> with TickerProviderStateMixin {
controller = PayController(context);
controller.getPaymentProcessors();
controller.getProducts(controller.model.selectedProvider?.uid ?? "");
controller.getProducts(controller.model.selectedProvider?.id ?? "");
transactionController = Provider.of<TransactionController>(
context,
listen: false,
@@ -303,7 +303,8 @@ class _PayScreenState extends State<PayScreen> with TickerProviderStateMixin {
if (showAdditionalRecipientDetails)
_buildAdditionalRecipientDetails(),
const SizedBox(height: 7),
if (controller.model.products.isNotEmpty)
if (controller.model.products.isNotEmpty ||
controller.model.isLoading)
_buildBillProductSelector(controller),
const SizedBox(height: 7),
_buildPhoneField(),