feat: add utility functions for date and quantity formatting; refactor inventory and recipe screens to use new formatters
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../../core/api/api_error_mapper.dart';
|
||||
import '../../../core/api/api_exception.dart';
|
||||
import '../../../core/utils/formatters.dart';
|
||||
import '../../../core/l10n/l10n.dart';
|
||||
import '../../auth/data/auth_providers.dart';
|
||||
import '../data/recipe_providers.dart';
|
||||
@@ -305,11 +306,7 @@ class _CreateRecipeScreenState extends ConsumerState<CreateRecipeScreen> {
|
||||
}
|
||||
|
||||
Widget _buildIngredientRow(int index, ParsedIngredient ing) {
|
||||
final qtyStr = ing.quantity > 0
|
||||
? (ing.quantity == ing.quantity.truncateToDouble()
|
||||
? '${ing.quantity.toInt()} '
|
||||
: '${ing.quantity} ')
|
||||
: '';
|
||||
final qtyStr = ing.quantity > 0 ? '${formatQuantity(ing.quantity)} ' : '';
|
||||
final unitStr = ing.unit.isNotEmpty ? '${ing.unit} ' : '';
|
||||
final noteStr = ing.note != null ? ' (${ing.note})' : '';
|
||||
final label = '$qtyStr$unitStr${ing.rawName}$noteStr';
|
||||
|
||||
Reference in New Issue
Block a user