Improve disconnect api (#192)

* Improve disconnect api

* Get disconnection event on Web from callback

* Wait for disconnection result on calling disconnect

* Improve linux disconnection

* Update Changelog

* Fix Ai comments
This commit is contained in:
Rohit Sangwan
2025-11-14 20:20:22 +05:30
committed by GitHub
parent 970db165dd
commit 09bb22750a
9 changed files with 181 additions and 89 deletions
@@ -260,8 +260,16 @@ class _PeripheralDetailPageState extends State<PeripheralDetailPage> {
PlatformButton(
text: 'Disconnect',
enabled: isConnected,
onPressed: () {
bleDevice.disconnect();
onPressed: () async {
try {
await bleDevice.disconnect();
_addLog("DisconnectResult", true);
} catch (e) {
_addLog(
'DisconnectError (${e.runtimeType})',
e,
);
}
},
),
],