themobilecoder / headset_connection_event

Flutter library to capture connect and disconnect events from headset
MIT License
7 stars 21 forks source link

For Android, the HeadsetState return null in Isolate mode #5

Open Ted-Zhang opened 3 years ago

Ted-Zhang commented 3 years ago

the HeadsetState returns null during Isolate, The return value of _channel.invokeMethod<int?>('getCurrentState') is -1

Tested it on Android. and the isolate is spawn when receiving the background push notification.

Thanks

shtreb commented 2 years ago

@Ted-Zhang I created fork and fix this problem. May be it isn't apply for you, but anyone can see it.

@themobilecoder , Can you look at my fork? https://github.com/shtreb/headset_connection_event