stopPreview method

  1. @override
Future<void> stopPreview()
override

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();
}