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