Add ability to select distance unit
Some checks failed
Some checks failed
This commit is contained in:
@@ -639,6 +639,7 @@ class _TractionPageState extends State<TractionPage> {
|
||||
|
||||
Widget _buildClassStatsCard(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final distanceUnits = context.watch<DistanceUnitService>();
|
||||
if (_classStatsLoading) {
|
||||
return Card(
|
||||
child: Padding(
|
||||
@@ -721,9 +722,27 @@ class _TractionPageState extends State<TractionPage> {
|
||||
children: [
|
||||
_metricTile('Had', hadCount),
|
||||
_metricTile('Entries', entriesWithClass),
|
||||
_metricTile('Avg mi / loco had', avgMileagePerLoco.toStringAsFixed(2)),
|
||||
_metricTile('Avg mi / entry', avgMileagePerEntry.toStringAsFixed(2)),
|
||||
_metricTile('Total mileage', totalMileage.toStringAsFixed(2)),
|
||||
_metricTile(
|
||||
'Avg distance / loco had',
|
||||
distanceUnits.format(
|
||||
avgMileagePerLoco,
|
||||
decimals: 2,
|
||||
),
|
||||
),
|
||||
_metricTile(
|
||||
'Avg distance / entry',
|
||||
distanceUnits.format(
|
||||
avgMileagePerEntry,
|
||||
decimals: 2,
|
||||
),
|
||||
),
|
||||
_metricTile(
|
||||
'Total distance',
|
||||
distanceUnits.format(
|
||||
totalMileage,
|
||||
decimals: 2,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Reference in New Issue
Block a user