pos changes
This commit is contained in:
@@ -208,10 +208,19 @@ class CartController extends StateNotifier<Cart> {
|
||||
setQuantity(productId, line.quantity + by);
|
||||
}
|
||||
|
||||
/// Steps a line down, never off the bill.
|
||||
///
|
||||
/// Floors at one deliberately. Taking the last unit away is a removal, and
|
||||
/// removals go through the PIN gate on the close button — a stepper that
|
||||
/// quietly reached zero was a way around it.
|
||||
void decrement(String productId, {double by = 1}) {
|
||||
final line = state.lineFor(productId);
|
||||
if (line == null) return;
|
||||
setQuantity(productId, line.quantity - by);
|
||||
|
||||
final next = line.quantity - by;
|
||||
if (next < 1) return;
|
||||
|
||||
setQuantity(productId, next);
|
||||
}
|
||||
|
||||
void removeLine(String productId) {
|
||||
|
||||
Reference in New Issue
Block a user