Initial and done prolly
This commit is contained in:
commit
6f88b9966f
175 changed files with 15445 additions and 0 deletions
47
lib/pages/main/widgets/soon_expiries_card.dart
Normal file
47
lib/pages/main/widgets/soon_expiries_card.dart
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:groceries_manager/pages/main/home_controller.dart';
|
||||
import 'package:groceries_manager/pages/main/widgets/product_widget.dart';
|
||||
|
||||
class SoonExpiriesCard extends GetView<HomeController> {
|
||||
const SoonExpiriesCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Card(
|
||||
child: Obx(
|
||||
() => controller.soonExpiries.isEmpty
|
||||
? const Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.sunny,
|
||||
size: 64,
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text("Ура, всем продуктам хорошо!"),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ListView(
|
||||
children: [
|
||||
for (final (prod, cat, store) in controller.soonExpiries)
|
||||
ProductWidget(
|
||||
key: ValueKey("se-holder-${prod.id}"),
|
||||
prod: prod,
|
||||
cat: cat,
|
||||
store: store,
|
||||
onEditClicked: (p) => controller.editProduct(p),
|
||||
onDeleteClicked: (p) => controller.deleteProduct(p),
|
||||
onAddToCartClicked: (p) =>
|
||||
controller.addToShoppingList(p),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue