Browse Source

Version updated and dartdocs added

master
Julian Finkler 1 year ago
parent
commit
d96581e552
  1. 12
      lib/barcode_scan.dart
  2. 2
      pubspec.yaml

12
lib/barcode_scan.dart

@ -2,10 +2,22 @@ import 'dart:async';
import 'package:flutter/services.dart';
/// Barcode scanner plugin
/// Simply call `var barcode = await BarcodeScanner.scan()` to scan a barcode
class BarcodeScanner {
/// If the user has not granted the access to the camera this code is thrown.
static const CameraAccessDenied = 'PERMISSION_NOT_GRANTED';
/// If the user cancel the scan an exception with this code is thrown.
static const UserCanceled = 'USER_CANCELED';
/// The method channel
static const MethodChannel _channel =
const MethodChannel('de.mintware.barcode_scan');
/// Starts the camera for scanning the barcode, shows a preview window and
/// returns the barcode if one was scanned.
/// Can throw an exception.
/// See also [CameraAccessDenied] and [UserCanceled]
static Future<String> scan() async => await _channel.invokeMethod('scan');
}

2
pubspec.yaml

@ -1,6 +1,6 @@
name: barcode_scan
description: A flutter plugin for scanning 2D barcodes and QRCodes via camera.
version: 1.0.0
version: 2.0.0
homepage: https://github.com/mintware-de/flutter_barcode_reader
dependencies:

Loading…
Cancel
Save