Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
Version updated and dartdocs added
Browse files Browse the repository at this point in the history
  • Loading branch information
devtronic committed Feb 19, 2020
1 parent 14a744d commit d96581e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/barcode_scan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit d96581e

Please sign in to comment.