diff --git a/lib/widgets/gps_compass.dart b/lib/widgets/gps_compass.dart index 3500256..dd5e024 100644 --- a/lib/widgets/gps_compass.dart +++ b/lib/widgets/gps_compass.dart @@ -16,6 +16,9 @@ class GpsCompass extends StatelessWidget { bool get _hasSignal => heading != null; bool get _isAcquiring => gpsState == 'acquiring'; + /// A fix but no heading: standing still, where GNSS cannot tell direction. Not a fault. + bool get _isStill => gpsState == 'fix' && !_hasSignal; + String get _displayHeading { if (!_hasSignal) return 'N/A'; return '${(heading! % 360).round()}'; @@ -50,8 +53,13 @@ class GpsCompass extends StatelessWidget { final theme = AppTheme.of(context); // No signal = subdued color, valid = foreground - // Heading: foreground; acquiring: caution; no receiver at all: alarm. - final iconColour = _hasSignal ? theme.foreground : (_isAcquiring ? theme.caution : theme.alarm); + // Heading: foreground; standing still with a fix: subdued; acquiring: caution; + // no receiver at all: alarm. + final iconColour = _hasSignal + ? theme.foreground + : (_isStill + ? theme.subdued + : (_isAcquiring ? theme.caution : theme.alarm)); // Convert to radians, 0 = no rotation when no signal final angle = _hasSignal ? (heading! * math.pi / 180.0) : 0.0; @@ -80,7 +88,7 @@ class GpsCompass extends StatelessWidget { child: Text( _hasSignal ? "$_displayHeading $_compassDirection" - : (_isAcquiring ? "ACQ" : "N/A"), + : (_isStill ? "—" : (_isAcquiring ? "ACQ" : "N/A")), style: TextStyle( fontSize: 80, color: theme.subdued, // less emphasis on text, let the icon have semantic colour