home added

This commit is contained in:
gitea
2026-08-31 12:57:17 +02:00
parent 92581e6d55
commit 7692809219
18 changed files with 1446 additions and 384 deletions
+11 -1
View File
@@ -39,6 +39,7 @@ class _ShopDetailScreenState extends State<ShopDetailScreen> {
void initState() {
super.initState();
_future = _load();
widget.repository.addListener(_reload);
widget.repository
.getUsedShopTags()
.then((tags) {
@@ -47,6 +48,12 @@ class _ShopDetailScreenState extends State<ShopDetailScreen> {
.catchError((_) {});
}
@override
void dispose() {
widget.repository.removeListener(_reload);
super.dispose();
}
Future<({Shop shop, List<ShopItem> items})> _load() async {
final shop = await widget.repository.getShop(widget.shopId);
if (shop == null) {
@@ -57,6 +64,7 @@ class _ShopDetailScreenState extends State<ShopDetailScreen> {
}
void _reload() {
if (!mounted) return;
setState(() => _future = _load());
}
@@ -276,7 +284,9 @@ class _ShopDetailScreenState extends State<ShopDetailScreen> {
formatEuro(item.price),
style: theme.textTheme.titleMedium,
),
onTap: _editing ? null : () => _openProduct(item.productId),
onTap: _editing || item.productId == null
? null
: () => _openProduct(item.productId!),
),
const Divider(),
ListTile(