runable
This commit is contained in:
8
lib/features/home/domain/usecases/calculate_total.dart
Normal file
8
lib/features/home/domain/usecases/calculate_total.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import '../entities/cart_item.dart';
|
||||
|
||||
/// Use case to calculate cart total
|
||||
class CalculateTotal {
|
||||
double call(List<CartItem> items) {
|
||||
return items.fold(0.0, (sum, item) => sum + item.total);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user