feat: alphabet list, change Layout etc

This commit is contained in:
2026-10-11 20:37:59 +02:00
parent 489896305d
commit 072f560989
31 changed files with 1847 additions and 832 deletions
+11 -1
View File
@@ -4,6 +4,9 @@ class Product {
final String category;
final int stockQuantity;
final int lowStockThreshold;
/// Never runs out; [stockQuantity] is left untouched by sales.
final bool infiniteStock;
final int priceInCents;
final String? imagePath;
final bool active;
@@ -14,12 +17,15 @@ class Product {
required this.category,
required this.stockQuantity,
required this.lowStockThreshold,
this.infiniteStock = false,
required this.priceInCents,
this.imagePath,
this.active = true,
});
bool get isLowStock => stockQuantity <= lowStockThreshold;
bool get isOutOfStock => !infiniteStock && stockQuantity <= 0;
bool get isLowStock => !infiniteStock && stockQuantity <= lowStockThreshold;
Product copyWith({
String? id,
@@ -27,6 +33,7 @@ class Product {
String? category,
int? stockQuantity,
int? lowStockThreshold,
bool? infiniteStock,
int? priceInCents,
String? imagePath,
bool? active,
@@ -37,6 +44,7 @@ class Product {
category: category ?? this.category,
stockQuantity: stockQuantity ?? this.stockQuantity,
lowStockThreshold: lowStockThreshold ?? this.lowStockThreshold,
infiniteStock: infiniteStock ?? this.infiniteStock,
priceInCents: priceInCents ?? this.priceInCents,
imagePath: imagePath ?? this.imagePath,
active: active ?? this.active,
@@ -52,6 +60,7 @@ class Product {
category == other.category &&
stockQuantity == other.stockQuantity &&
lowStockThreshold == other.lowStockThreshold &&
infiniteStock == other.infiniteStock &&
priceInCents == other.priceInCents &&
imagePath == other.imagePath &&
active == other.active;
@@ -63,6 +72,7 @@ class Product {
category,
stockQuantity,
lowStockThreshold,
infiniteStock,
priceInCents,
imagePath,
active,
+11
View File
@@ -0,0 +1,11 @@
/// Why an over-the-air update stopped. Views translate it with
/// `AppLocalizations.updateFailureText`.
enum UpdateFailure {
download,
checksum,
permission,
install,
alreadyRunning,
simulated,
unknown,
}