Julian Steenbakker

doc: add changelog

... ... @@ -3,6 +3,9 @@ You can provide a path to controller.analyzeImage(path) in order to scan a local
Check out the example app to see how you can use the image_picker plugin to retrieve a photo from
the gallery. Please keep in mind that this feature is only supported on Android and iOS.
Another feature that has been added is a format selector!
Just keep in mind that iOS for now only supports 1 selected barcode.
## 0.1.3
* Fixed crash after asking permission. [#29](https://github.com/juliansteenbakker/mobile_scanner/issues/29)
* Upgraded cameraX from 1.1.0-beta01 to 1.1.0-beta02
... ...
... ... @@ -17,7 +17,7 @@ class _BarcodeScannerWithControllerState
MobileScannerController controller = MobileScannerController(
torchEnabled: true,
// formats: [BarcodeFormat.ean13, BarcodeFormat.ean8]
// formats: [BarcodeFormat.qrCode]
// facing: CameraFacing.front,
);
... ...
... ... @@ -24,12 +24,9 @@ class MobileScanner extends StatefulWidget {
final BoxFit fit;
/// Create a [MobileScanner] with a [controller], the [controller] must has been initialized.
const MobileScanner({
Key? key,
this.onDetect,
this.controller,
this.fit = BoxFit.cover
}) : super(key: key);
const MobileScanner(
{Key? key, this.onDetect, this.controller, this.fit = BoxFit.cover})
: super(key: key);
@override
State<MobileScanner> createState() => _MobileScannerState();
... ...
... ... @@ -43,6 +43,10 @@ class MobileScannerController {
late final ValueNotifier<CameraFacing> cameraFacingState;
final Ratio? ratio;
final bool? torchEnabled;
/// If provided, the scanner will only detect those specific formats.
///
/// WARNING: On iOS, only 1 format is supported.
final List<BarcodeFormat>? formats;
CameraFacing facing;
... ... @@ -52,7 +56,10 @@ class MobileScannerController {
Stream<Barcode> get barcodes => barcodesController.stream;
MobileScannerController(
{this.facing = CameraFacing.back, this.ratio, this.torchEnabled, this.formats}) {
{this.facing = CameraFacing.back,
this.ratio,
this.torchEnabled,
this.formats}) {
// In case a new instance is created before calling dispose()
if (_controllerHashcode != null) {
stop();
... ... @@ -146,7 +153,6 @@ class MobileScannerController {
} else if (Platform.isIOS || Platform.isMacOS) {
arguments['formats'] = formats!.map((e) => e.rawValue).toList();
}
}
// Start the camera with arguments
... ...
... ... @@ -554,7 +554,6 @@ enum BarcodeFormat {
}
extension BarcodeValue on BarcodeFormat {
int get rawValue {
switch (this) {
case BarcodeFormat.unknown:
... ... @@ -589,7 +588,6 @@ extension BarcodeValue on BarcodeFormat {
return 4096;
}
}
}
/// Address type constants.
... ...