medyas / flutter_qiblah

Flutter Qiblah is a plugin that allows you to display Qiblah direction in you app with support for both Android and iOS.
https://pub.dev/packages/flutter_qiblah
MIT License
134 stars 97 forks source link

Drain issue, please fix the following #2

Closed S1nPur1ty closed 4 years ago

S1nPur1ty commented 4 years ago

First of all, thank you so much for the help dear brother! I noticed that in the dispose method, you forgot the use .drain() functionality before disposing it, so here is the fix.

Please update your dispose method:

 /// Close compass stream, and set Qiblah stream to null
  dispose() async {
    await _qiblahStream.drain();
    _qiblahStream = null;
    FlutterCompass().dispose();
  }
medyas commented 4 years ago

I did not forgot, calling drainis not a common things, as it will probably cause this error : Calling Drain on a Stream . Both of compass and location stream will never stop emitting, and so if we call drainit will never complete. Your welcome to make a fork and test it.

S1nPur1ty commented 4 years ago

I did not forgot, calling drainis not a common things, as it will probably cause this error : Calling Drain on a Stream . Both of compass and location stream will never stop emitting, and so if we call drainit will never complete. Your welcome to make a fork and test it.

Thanks for providing this source. I will let you know when changes take place.