Open mjablecnik opened 2 years ago
Can you call onCancel to unregister the receiver? https://github.com/ZebraDevs/DataWedge-Flutter-Demo/blob/master/datawedge_flutter/android/app/src/main/kotlin/com/darryncampbell/datawedgeflutter/MainActivity.kt#L42 Sorry, it has been a while since I looked at the code.
Thank you for your so quick answer.
Yes I know about onCancel
function in Kotlin code but I don't know how can I call it correctly from Dart code.
If you can update this Flutter demo, it would be very helpful for me..
I am trying call something like this:
But it doesn't solve it.
Unfortunately I am not able to work on this project right now but I suggest you do the following:
await methodChannel.invokeMethod('unregisterReceiver', '');
. Similar to the existing code to create the DataWedge profile at https://github.com/ZebraDevs/DataWedge-Flutter-Demo/blob/master/datawedge_flutter/lib/main.dart#L56'unregisterReceiver'
method, in much the same way that it already handles the 'createDataWedgeProfile'
method at https://github.com/ZebraDevs/DataWedge-Flutter-Demo/blob/master/datawedge_flutter/android/app/src/main/kotlin/com/darryncampbell/datawedgeflutter/MainActivity.kt#L58This plugin / sample is released under MIT so there are no restrictions to modification & distribution.
Hello, when I quit your demo application so this error exception is showed:
I understand that there is somewhere missing
unregisterReceiver()
function which is called for unregister dataWedge. How can I prevent this error?