Added loading message

This commit is contained in:
Winston Lowe 2026-01-07 00:59:56 -08:00
parent 2993ec1f49
commit 401a3842ca

View file

@ -72,15 +72,9 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
void _handleStatusResponse(BuildContext context, Uint8List frame) {
setState(() {
_isLoading = false;
_isLoaded = true;
_parsedTelemetry = CayenneLpp.parseByChannel(frame);
});
for (final entry in _parsedTelemetry![1]!.values) {
print('Telemetry - Channel: ${entry['channel']}, Type: ${entry['type']}, Value: ${entry['value']}');
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Received status response (not implemented).'),
@ -268,8 +262,16 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
child: ListView(
padding: const EdgeInsets.all(16),
children: [
for (final entry in _parsedTelemetry ?? [])
_buildChannelInfoCard(entry['values'], 'Channel ${entry['channel']}', entry['channel']),
if (_isLoaded && !(_parsedTelemetry == null || _parsedTelemetry!.isEmpty))
for (final entry in _parsedTelemetry ?? [])
_buildChannelInfoCard(entry['values'], 'Channel ${entry['channel']}', entry['channel']),
if (!_isLoaded && (_parsedTelemetry == null || _parsedTelemetry!.isEmpty))
const Center(
child: Text(
'No telemetry data available.',
style: TextStyle(fontSize: 16, color: Colors.grey),
),
),
],
),
),
@ -286,7 +288,7 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
children: [
Row(
children: [
Icon(Icons.info_outline, color: Theme.of(context).primaryColor),
Icon(Icons.info_outline, color: Theme.of(context).textTheme.headlineSmall?.color),
const SizedBox(width: 8),
Text(
title,