mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-27 22:16:37 +10:00
Handle loading state and error parsing in PathTraceMapScreen; update SNR indicator dialog content layout
This commit is contained in:
@@ -166,6 +166,15 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (code == respCodeErr) {
|
||||||
|
_timeoutTimer?.cancel();
|
||||||
|
if (!mounted) return;
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
_failed2Loaded = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Check if it's a binary response
|
// Check if it's a binary response
|
||||||
if (frame.length > 8 &&
|
if (frame.length > 8 &&
|
||||||
code == pushCodeTraceData &&
|
code == pushCodeTraceData &&
|
||||||
@@ -178,6 +187,12 @@ class _PathTraceMapScreenState extends State<PathTraceMapScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
_timeoutTimer?.cancel();
|
||||||
|
if (!mounted) return;
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
_failed2Loaded = true;
|
||||||
|
});
|
||||||
// Handle any parsing errors gracefully
|
// Handle any parsing errors gracefully
|
||||||
appLogger.error('Error parsing frame: $e', tag: 'PathTraceMapScreen');
|
appLogger.error('Error parsing frame: $e', tag: 'PathTraceMapScreen');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ class _SNRIndicatorState extends State<SNRIndicator> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: Text(l10n.snrIndicator_nearByRepeaters),
|
title: Text(l10n.snrIndicator_nearByRepeaters),
|
||||||
content: Expanded(
|
content: SizedBox(
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
|||||||
Reference in New Issue
Block a user