Navaron Bracke

emit running false before actually stopping the camera

@@ -267,14 +267,14 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> { @@ -267,14 +267,14 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
267 267
268 _throwIfNotInitialized(); 268 _throwIfNotInitialized();
269 269
270 - await MobileScannerPlatform.instance.stop();  
271 -  
272 // After the camera stopped, set the torch state to off, 270 // After the camera stopped, set the torch state to off,
273 // as the torch state callback is never called when the camera is stopped. 271 // as the torch state callback is never called when the camera is stopped.
274 value = value.copyWith( 272 value = value.copyWith(
275 isRunning: false, 273 isRunning: false,
276 torchState: TorchState.off, 274 torchState: TorchState.off,
277 ); 275 );
  276 +
  277 + await MobileScannerPlatform.instance.stop();
278 } 278 }
279 279
280 /// Switch between the front and back camera. 280 /// Switch between the front and back camera.