fix: continuing error managment and documentation

This commit is contained in:
alzalia1 2025-08-23 12:35:36 +02:00
parent 59e1c2558c
commit dad000a1b9
24 changed files with 389 additions and 182 deletions

View file

@ -65,7 +65,7 @@ class _ScanScreenState extends State<ScanScreen> {
children: [
IconButton(
onPressed: () {
widget.viewModel.showScan = false;
widget.viewModel.showScanScreen = false;
},
icon: Icon(Icons.arrow_back),
),

View file

@ -34,9 +34,9 @@ class SellChoicePopup extends StatelessWidget {
child: Card(
child: InkWell(
onTap: () {
viewModel.sellBook(book);
viewModel.addBookToSell(book);
Navigator.of(context).pop();
viewModel.showScan = false;
viewModel.showScanScreen = false;
},
child: ListTile(
leading: Text(

View file

@ -28,7 +28,7 @@ class _SellPageState extends State<SellPage> {
builder: (context, child) {
return switch (widget.viewModel.isLoaded) {
false => AwaitLoading(),
true => switch (widget.viewModel.currentBal) {
true => switch (widget.viewModel.ongoingBal) {
null => Center(
child: SizedBox(
width: 300,
@ -80,7 +80,7 @@ class _SellPageState extends State<SellPage> {
? Center(child: Text("Aucun"))
: SizedBox(),
for (BookStack book
in widget.viewModel.soldBooks)
in widget.viewModel.booksInSell)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 15,
@ -99,9 +99,10 @@ class _SellPageState extends State<SellPage> {
),
trailing: IconButton(
onPressed: () {
widget.viewModel.deleteBook(
book.instance.id,
);
widget.viewModel
.removeBookFromSell(
book.instance.id,
);
},
icon: Icon(Icons.delete),
),
@ -113,7 +114,7 @@ class _SellPageState extends State<SellPage> {
),
SizedBox(height: 40),
Text(
"Montant minimum à payer : ${widget.viewModel.minimumAmount.toString()}",
"Montant minimum à payer : ${widget.viewModel.minimumAmountToPay.toString()}",
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 60.0),
@ -167,7 +168,7 @@ class _SellPageState extends State<SellPage> {
} else if (double.parse(
price.text.replaceFirst(",", "."),
) <
widget.viewModel.minimumAmount) {
widget.viewModel.minimumAmountToPay) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
@ -202,7 +203,7 @@ class _SellPageState extends State<SellPage> {
SizedBox(width: 70),
IconButton(
onPressed: () {
widget.viewModel.showScan = true;
widget.viewModel.showScanScreen = true;
},
icon: Icon(Icons.add),
style: ButtonStyle(
@ -216,7 +217,7 @@ class _SellPageState extends State<SellPage> {
],
),
),
(widget.viewModel.showScan)
(widget.viewModel.showScanScreen)
? ScanScreen(viewModel: widget.viewModel)
: SizedBox(),
],