chipweinberger / flutter_blue_plus

Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android, iOS, macOS
Other
791 stars 479 forks source link

[Feature]: return early if turnOn is rejected #692

Closed ToxicGamer-exe closed 1 year ago

ToxicGamer-exe commented 1 year ago

FlutterBluePlus Version

1.28.13

Flutter Version

3.10.6

What OS?

Android

OS Version

Android 11

Bluetooth Module

Not needed

What is your feature request?

I'd like to get bool, that would indicate whether the user accepted or rejected the turnOn() dialog. Not only the func doesn't return anything, but if the user rejects, the awaited request is stuck unless the timeout goes out and then it throws exception (basically the only indication user didn't accept). Ending the timeout after the rejection would be appreciated ofc :D

Logs

No logs needed
chipweinberger commented 1 year ago

if you want this, feel free to open a PR.

i'd merge it.

it would be made to throw a "userRejected" exception. not a bool.

chipweinberger commented 1 year ago

I've pushed a fix to master branch. try it out! untested.

dependencies:
  flutter_blue_plus:
    git:
      url: git://github.com/boskokg/flutter_blue_plus
      ref: master
ToxicGamer-exe commented 1 year ago

I'm gonna test it right out, thanks in advance! :)

chipweinberger commented 1 year ago

just tested it, it works.

chipweinberger commented 1 year ago

added in 1.29.5