|
|
|
@@ -251,7 +251,7 @@ class QRViewController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// Pauses barcode scanning |
|
|
|
/// Pauses the camera and barcode scanning |
|
|
|
Future<void> pauseCamera() async { |
|
|
|
try { |
|
|
|
await _channel.invokeMethod('pauseCamera'); |
|
|
|
@@ -260,6 +260,15 @@ class QRViewController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// Stops barcode scanning and the camera |
|
|
|
Future<void> stopCamera() async { |
|
|
|
try { |
|
|
|
await _channel.invokeMethod('stopCamera'); |
|
|
|
} on PlatformException catch (e) { |
|
|
|
throw CameraException(e.code, e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// Resumes barcode scanning |
|
|
|
Future<void> resumeCamera() async { |
|
|
|
try { |
|
|
|
@@ -280,8 +289,9 @@ class QRViewController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// Disposes the barcode stream. |
|
|
|
/// Stops the camera and disposes the barcode stream. |
|
|
|
void dispose() { |
|
|
|
stopCamera(); |
|
|
|
_scanUpdateController.close(); |
|
|
|
} |
|
|
|
|
|
|
|
|