Updated speed displays

This commit is contained in:
Mikkeli Matlock
2025-08-25 07:41:49 +09:00
parent b3e85983e7
commit e6ffb00b2a
3 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ class ColorThemes {
name: 'Yuuparo Light', name: 'Yuuparo Light',
background: Color.fromARGB(255, 228, 235, 238), background: Color.fromARGB(255, 228, 235, 238),
speedText: Color.fromARGB(255, 85, 99, 112), speedText: Color.fromARGB(255, 85, 99, 112),
headingText: Color.fromARGB(255, 255, 171, 16), headingText: Color.fromARGB(255, 255, 157, 65),
unitText: Color.fromARGB(255, 98, 124, 118), unitText: Color.fromARGB(255, 98, 124, 118),
), ),
]; ];
-1
View File
@@ -10,7 +10,6 @@ class GpsService {
locationSettings: const LocationSettings( locationSettings: const LocationSettings(
accuracy: LocationAccuracy.bestForNavigation, accuracy: LocationAccuracy.bestForNavigation,
distanceFilter: 0, distanceFilter: 0,
timeLimit: Duration(seconds: 5),
), ),
); );
} }
+11 -5
View File
@@ -92,7 +92,13 @@ class _SpeedometerScreenState extends State<SpeedometerScreen> {
_positionSubscription = GpsService.positionStream.listen( _positionSubscription = GpsService.positionStream.listen(
_onPositionUpdate, _onPositionUpdate,
onError: (error) => setState(() => _errorMessage = 'GPS error: $error'), onError: (error) {
// Only show persistent GPS errors, not temporary signal issues
final errorString = error.toString().toLowerCase();
if (!errorString.contains('timeout') && !errorString.contains('temporarily')) {
setState(() => _errorMessage = 'GPS error: $error');
}
},
); );
} catch (e) { } catch (e) {
setState(() => _errorMessage = 'Failed to initialize GPS'); setState(() => _errorMessage = 'Failed to initialize GPS');
@@ -120,10 +126,10 @@ class _SpeedometerScreenState extends State<SpeedometerScreen> {
} }
String _getSpeedDisplayText(double displaySpeed) { String _getSpeedDisplayText(double displaySpeed) {
if (_speed == 0.0 && _heading == -1.0) { if (_speed < 1.0 && (_heading < 0.0 || _heading >= 360.0)) {
return '--'; return '--';
} }
return displaySpeed.toStringAsFixed(0); return displaySpeed.toStringAsFixed(1);
} }
@override @override
@@ -159,7 +165,7 @@ class _SpeedometerScreenState extends State<SpeedometerScreen> {
child: Container( child: Container(
width: double.infinity, width: double.infinity,
color: Colors.transparent, color: Colors.transparent,
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(12),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@@ -185,7 +191,7 @@ class _SpeedometerScreenState extends State<SpeedometerScreen> {
child: Text( child: Text(
speedText, speedText,
style: TextStyle( style: TextStyle(
fontSize: 200, fontSize: 160,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
color: currentTheme.speedText, color: currentTheme.speedText,
fontFamily: 'DIN1451Alt', fontFamily: 'DIN1451Alt',