From ce7338db2a05f15fc1d8f4fc798b50741091e076 Mon Sep 17 00:00:00 2001 From: alzalia1 Date: Wed, 20 Aug 2025 14:12:45 +0200 Subject: [PATCH] fix: didn't check for empty sell --- lib/ui/sell_page/widgets/sell_page.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ui/sell_page/widgets/sell_page.dart b/lib/ui/sell_page/widgets/sell_page.dart index e7832b1..b04ae81 100644 --- a/lib/ui/sell_page/widgets/sell_page.dart +++ b/lib/ui/sell_page/widgets/sell_page.dart @@ -140,6 +140,17 @@ class _SellPageState extends State { children: [ IconButton( onPressed: () { + if (widget.viewModel.scannedBooks.isEmpty) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + "La vente doit comporter au moins un livre", + ), + behavior: SnackBarBehavior.floating, + ), + ); + return; + } if (double.tryParse( price.text.replaceFirst(",", "."), ) ==