fix: formatting
This commit is contained in:
@@ -98,7 +98,7 @@ class _ClosedTabCardState extends State<ClosedTabCard> {
|
||||
const Divider(height: 1),
|
||||
const SizedBox(height: 8),
|
||||
...closedTab.items.map(
|
||||
(item) => _ClosedTabItemRow(item: item),
|
||||
(item) => _ClosedTabItemRow(item: item),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -120,10 +120,12 @@ class _ClosedTabItemRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final unitPrice =
|
||||
NumberFormat.simpleCurrency().format(item.unitPriceInCents / 100);
|
||||
final lineTotal =
|
||||
NumberFormat.simpleCurrency().format(item.lineTotalInCents / 100);
|
||||
final unitPrice = NumberFormat.simpleCurrency().format(
|
||||
item.unitPriceInCents / 100,
|
||||
);
|
||||
final lineTotal = NumberFormat.simpleCurrency().format(
|
||||
item.lineTotalInCents / 100,
|
||||
);
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
|
||||
return Padding(
|
||||
@@ -135,7 +137,10 @@ class _ClosedTabItemRow extends StatelessWidget {
|
||||
item.productName,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontWeight: FontWeight.w600, color: scheme.onSurface),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -148,11 +153,14 @@ class _ClosedTabItemRow extends StatelessWidget {
|
||||
child: Text(
|
||||
lineTotal,
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(fontWeight: FontWeight.w700, color: scheme.onSurface),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class SlideConfirm extends StatefulWidget {
|
||||
final VoidCallback onConfirmed;
|
||||
|
||||
@@ -95,4 +94,4 @@ class _SlideConfirmState extends State<SlideConfirm> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user