stopPreview method
Stops the preview stream and unregisters the texture.
Implementation
@override
Future<void> stopPreview() async {
// Dropping the view type makes buildPreview return an empty widget, so
// Flutter tears the platform view down by itself. The media stream keeps
// running so captureFrame() and a later startPreview() still work.
_viewTypes.clear();
}