5122be4bc1
- Move SpeedUnit enum to config/speed_unit.dart - Move ColorTheme/ColorThemes classes to config/color_themes.dart - Extract ProcessedGpsData model from gps_data_manager to models/ - Create OverlayMessage typed class for overlay IPC (replaces raw Maps) - Create ThemeModel with palette rotation and state management
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];
|
|
}
|
|
}
|