Showing
1 changed file
with
8 additions
and
2 deletions
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | 2 | ||
| 3 | -import 'package:flutter/foundation.dart'; | ||
| 4 | -import 'package:flutter/services.dart'; | 3 | +import 'package:flutter/widgets.dart'; |
| 5 | import 'package:mobile_scanner/src/enums/barcode_format.dart'; | 4 | import 'package:mobile_scanner/src/enums/barcode_format.dart'; |
| 6 | import 'package:mobile_scanner/src/enums/camera_facing.dart'; | 5 | import 'package:mobile_scanner/src/enums/camera_facing.dart'; |
| 7 | import 'package:mobile_scanner/src/enums/detection_speed.dart'; | 6 | import 'package:mobile_scanner/src/enums/detection_speed.dart'; |
| @@ -159,6 +158,13 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> { | @@ -159,6 +158,13 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> { | ||
| 159 | return MobileScannerPlatform.instance.analyzeImage(path); | 158 | return MobileScannerPlatform.instance.analyzeImage(path); |
| 160 | } | 159 | } |
| 161 | 160 | ||
| 161 | + /// Build a camera preview widget. | ||
| 162 | + Widget buildCameraView() { | ||
| 163 | + _throwIfNotInitialized(); | ||
| 164 | + | ||
| 165 | + return MobileScannerPlatform.instance.buildCameraView(); | ||
| 166 | + } | ||
| 167 | + | ||
| 162 | /// Reset the zoom scale of the camera. | 168 | /// Reset the zoom scale of the camera. |
| 163 | Future<void> resetZoomScale() async { | 169 | Future<void> resetZoomScale() async { |
| 164 | _throwIfNotInitialized(); | 170 | _throwIfNotInitialized(); |
-
Please register or login to post a comment