From a51321df3a322b1caef22e79219c417be698fd99 Mon Sep 17 00:00:00 2001 From: Rotheem <114694873+Rotheem@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:15:27 +0200 Subject: [PATCH] Fix: purchase scan button (#423) --- .../providers/purchases_admin_provider.dart | 12 +++--------- lib/purchases/ui/pages/scan_page/scan_dialog.dart | 8 ++++++++ pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/purchases/providers/purchases_admin_provider.dart b/lib/purchases/providers/purchases_admin_provider.dart index d40e09a22..959f6bb97 100644 --- a/lib/purchases/providers/purchases_admin_provider.dart +++ b/lib/purchases/providers/purchases_admin_provider.dart @@ -10,14 +10,8 @@ final isPurchasesAdminProvider = StateProvider((ref) { .contains("c1275229-46b2-4e53-a7c4-305513bb1a2a")) { return true; } - sellers.when( - data: (data) { - if (data.isNotEmpty) { - return true; - } - }, - loading: () {}, - error: (error, stackTrace) {}, + return sellers.maybeWhen( + data: (data) => data.isNotEmpty, + orElse: () => false, ); - return false; }); diff --git a/lib/purchases/ui/pages/scan_page/scan_dialog.dart b/lib/purchases/ui/pages/scan_page/scan_dialog.dart index 14dc0ed3c..74dcae7af 100644 --- a/lib/purchases/ui/pages/scan_page/scan_dialog.dart +++ b/lib/purchases/ui/pages/scan_page/scan_dialog.dart @@ -185,6 +185,14 @@ class ScanDialog extends HookConsumerWidget { ), ), const SizedBox(height: 10), + Text( + "Variant : ${data.productVariant.nameFR}", + style: const TextStyle( + fontSize: 16, + color: Colors.black, + ), + ), + const SizedBox(height: 10), Text( "${data.scanLeft.toString()} / ${ticket.maxUse} ${PurchasesTextConstants.leftScan}", style: const TextStyle( diff --git a/pubspec.yaml b/pubspec.yaml index c3877a6d6..e92f072fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: myecl description: MyECL est l'application des Centraliens de Lyon, conçue par ÉCLAIR publish_to: "none" -version: 0.10.1+131 +version: 0.10.2+132 environment: sdk: ^3.3.0