44480eb969
- Move constants from lib/config/ to lib/core/constants/ - Move color themes to lib/core/theme/ - Create LocationData domain model in data/models/ - Create lightweight GpsService in data/services/ - Create LocationRepository in data/repositories/ consolidating GpsDataManager business logic (GPS stream, staleness, precision) - Create shared SpeedDisplay widget in ui/shared/ - Defer overlay feature — stubs reserved in ui/features/overlay/
21 lines
436 B
Dart
21 lines
436 B
Dart
enum SpeedUnit {
|
|
kmh('km/h', 1.0),
|
|
mph('mph', 0.621371),
|
|
knots('kts', 0.539957);
|
|
|
|
const SpeedUnit(this.label, this.multiplier);
|
|
|
|
final String label;
|
|
final double multiplier;
|
|
|
|
double convert(double speedMps) {
|
|
return speedMps * 3.6 * multiplier;
|
|
}
|
|
|
|
SpeedUnit get next {
|
|
final values = SpeedUnit.values;
|
|
final currentIndex = values.indexOf(this);
|
|
return values[(currentIndex + 1) % values.length];
|
|
}
|
|
}
|