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

This commit is contained in:
Nils-Johan Gynther
2026-05-04 20:50:18 +02:00
parent a645d6a364
commit 5411dfe2c0
9 changed files with 40 additions and 41 deletions
@@ -6,6 +6,7 @@ import 'package:go_router/go_router.dart';
import 'package:intl/intl.dart';
import '../../../core/api/api_error_mapper.dart';
import '../../../core/utils/formatters.dart';
import '../../../core/l10n/l10n.dart';
import '../../../core/ui/async_state_views.dart';
import '../../auth/data/auth_providers.dart';
@@ -591,8 +592,5 @@ class _EnrichedShoppingItem {
}
}
String _formatQuantity(double value) {
final normalized = value == value.roundToDouble() ? value.toStringAsFixed(0) : value.toStringAsFixed(1);
return normalized.replaceAll(RegExp(r'\.0$'), '');
}
String _formatQuantity(double value) => formatQuantity(value);
}