mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 08:20:36 +00:00
fix: defer dialog scan start
ref:
This commit is contained in:
@@ -47,12 +47,16 @@ class _ConnectionDialogState extends State<ConnectionDialog>
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
|
||||
// Start BLE scan by default
|
||||
final connectionProvider = Provider.of<ConnectionProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
);
|
||||
connectionProvider.startScan();
|
||||
// Defer scan startup until after the first frame so Provider listeners
|
||||
// are not notified while this dialog is still being built.
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
final connectionProvider = Provider.of<ConnectionProvider>(
|
||||
context,
|
||||
listen: false,
|
||||
);
|
||||
connectionProvider.startScan();
|
||||
});
|
||||
|
||||
// Set up network scanner callbacks
|
||||
_networkScanner.onServerDiscovered = (server) {
|
||||
|
||||
@@ -883,7 +883,7 @@ packages:
|
||||
description:
|
||||
path: "."
|
||||
ref: main
|
||||
resolved-ref: "1617d41ce6e23e00bfad497dbd42259a21302689"
|
||||
resolved-ref: "47baadb13d5b1b92d1837042ff6b8a39b685295b"
|
||||
url: "https://github.com/dz0ny/meshcore_client.git"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
|
||||
Reference in New Issue
Block a user