mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-06 16:56:41 +10:00
Added Line Of Sight Feature for repeater placement, Added app wide Units Setting (#198)
* feat: add LOS workflow, global units, l10n cleanup, and mobile UI overflow fixes Squashes prior PR commits into one changeset including: LOS map/service/tests, global metric/imperial unit system adoption, notification/BLE safety fixes, app-wide localization backfill/mojibake cleanup, and responsive UI title/overflow hardening. * l10n: revert unrelated locale churn for LOS feature * feat: keep LOS with app-wide unit settings * fix: resolve post-merge app bar/import analyzer errors * style: format screen files for CI
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import '../connector/meshcore_protocol.dart';
|
||||
|
||||
class BleDebugLogEntry {
|
||||
@@ -44,6 +45,7 @@ class BleDebugLogService extends ChangeNotifier {
|
||||
static const int maxEntries = 500;
|
||||
final List<BleDebugLogEntry> _entries = [];
|
||||
final List<BleRawLogRxEntry> _rawLogRxEntries = [];
|
||||
bool _notifyScheduled = false;
|
||||
|
||||
List<BleDebugLogEntry> get entries => List.unmodifiable(_entries);
|
||||
List<BleRawLogRxEntry> get rawLogRxEntries =>
|
||||
@@ -78,13 +80,31 @@ class BleDebugLogService extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
notifyListeners();
|
||||
_notifyListenersSafely();
|
||||
}
|
||||
|
||||
void clear() {
|
||||
_entries.clear();
|
||||
_rawLogRxEntries.clear();
|
||||
notifyListeners();
|
||||
_notifyListenersSafely();
|
||||
}
|
||||
|
||||
void _notifyListenersSafely() {
|
||||
final phase = SchedulerBinding.instance.schedulerPhase;
|
||||
final canNotifyNow =
|
||||
phase == SchedulerPhase.idle ||
|
||||
phase == SchedulerPhase.postFrameCallbacks;
|
||||
if (canNotifyNow) {
|
||||
notifyListeners();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_notifyScheduled) return;
|
||||
_notifyScheduled = true;
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
_notifyScheduled = false;
|
||||
notifyListeners();
|
||||
});
|
||||
}
|
||||
|
||||
String _describeFrame(
|
||||
|
||||
Reference in New Issue
Block a user