fix: formatting
This commit is contained in:
@@ -3,7 +3,6 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kooltab2/models/product.dart';
|
||||
|
||||
|
||||
class ProductTile extends StatelessWidget {
|
||||
final Product product;
|
||||
final bool enabled;
|
||||
@@ -33,7 +32,7 @@ class ProductTile extends StatelessWidget {
|
||||
final outOfStock = product.stockQuantity <= 0;
|
||||
final lowStock =
|
||||
product.stockQuantity > 0 &&
|
||||
product.stockQuantity <= product.lowStockThreshold; // adjust name
|
||||
product.stockQuantity <= product.lowStockThreshold; // adjust name
|
||||
|
||||
final borderColor = outOfStock
|
||||
? scheme.error.withValues(alpha: 0.7)
|
||||
@@ -62,16 +61,16 @@ class ProductTile extends StatelessWidget {
|
||||
opacity: outOfStock ? 0.35 : (enabled ? 1 : 0.4),
|
||||
child: _hasImage
|
||||
? Image.file(
|
||||
File(product.imagePath!),
|
||||
fit: BoxFit.scaleDown,
|
||||
)
|
||||
File(product.imagePath!),
|
||||
fit: BoxFit.scaleDown,
|
||||
)
|
||||
: Center(
|
||||
child: Icon(
|
||||
Icons.image_not_supported_outlined,
|
||||
size: 34,
|
||||
color: scheme.onSurface.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.image_not_supported_outlined,
|
||||
size: 34,
|
||||
color: scheme.onSurface.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
if (_hasImage)
|
||||
@@ -95,9 +94,7 @@ class ProductTile extends StatelessWidget {
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 10,
|
||||
child: _StockBadge(
|
||||
product: product,
|
||||
),
|
||||
child: _StockBadge(product: product),
|
||||
),
|
||||
|
||||
// Out of stock overlay
|
||||
@@ -134,9 +131,7 @@ class ProductTile extends StatelessWidget {
|
||||
class _StockBadge extends StatelessWidget {
|
||||
final Product product;
|
||||
|
||||
const _StockBadge({
|
||||
required this.product,
|
||||
});
|
||||
const _StockBadge({required this.product});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -150,10 +145,7 @@ class _StockBadge extends StatelessWidget {
|
||||
product.stockQuantity <= product.lowStockThreshold; // adjust name
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: low
|
||||
? Colors.amber.withValues(alpha: 0.9)
|
||||
@@ -170,4 +162,4 @@ class _StockBadge extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user