feat: scan book to add to sell
This commit is contained in:
parent
3a013c829f
commit
07c7c98edb
11 changed files with 238 additions and 31 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:seshat/domain/models/book_instance.dart';
|
||||
import 'package:seshat/domain/models/book_stack.dart';
|
||||
import 'package:seshat/routing/routes.dart';
|
||||
import 'package:seshat/ui/core/ui/navigation_bar.dart';
|
||||
import 'package:seshat/ui/sell_page/view_model/sell_view_model.dart';
|
||||
|
|
@ -75,8 +75,7 @@ class _SellPageState extends State<SellPage> {
|
|||
(widget.viewModel.scannedBooks.isEmpty)
|
||||
? Center(child: Text("Aucun"))
|
||||
: SizedBox(),
|
||||
for (BookInstance bookInstance
|
||||
in widget.viewModel.scannedBooks)
|
||||
for (BookStack book in widget.viewModel.soldBooks)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 15,
|
||||
|
|
@ -84,19 +83,19 @@ class _SellPageState extends State<SellPage> {
|
|||
child: Card(
|
||||
child: ListTile(
|
||||
leading: Text(
|
||||
"${bookInstance.price.toString()}€",
|
||||
"${book.instance.price.toString()}€",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
title: Text(
|
||||
"Les chiens et la charrue · Patrick K. Dewdney ${bookInstance.id}",
|
||||
"${book.book.title} · ${book.book.author}",
|
||||
),
|
||||
subtitle: Text(
|
||||
"Union Étudiante Auvergne",
|
||||
"${book.owner.firstName} ${book.owner.lastName} (${book.shortId()})",
|
||||
),
|
||||
trailing: IconButton(
|
||||
onPressed: () {
|
||||
widget.viewModel.deleteBook(
|
||||
bookInstance.id,
|
||||
book.instance.id,
|
||||
);
|
||||
},
|
||||
icon: Icon(Icons.delete),
|
||||
|
|
|
|||
Reference in a new issue