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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user