web_document_scanner 0.0.3 copy "web_document_scanner: ^0.0.3" to clipboard
web_document_scanner: ^0.0.3 copied to clipboard

Platformweb

Web Document Scanner Example

Web Document Scanner

PubVersion PubPoints build Star on Github Latest Dartdocs

ios

A Flutter Package to Scan Document on WEB.

Contents: #

Getting Started #

Add dependencies in the pubspec.yaml:

dependencies:
  web_document_scanner: ^latest

Get the Changes by:

flutter pub get

or

dart pub get

Usage #

import 'package:web_document_scanner/web_document_scanner.dart';

Controller must be initialized:

  void _controllerInitialization() async {
  scannerStatus = ScannerStatus.initializing;
  final List<CameraDescription> cameras = await availableCameras();
  if (cameras.isNotEmpty) {
    final CameraDescription selectedCamera = cameras.first;
    scannerController = ScannerController(description: selectedCamera);
    if (scannerController != null) {
      await scannerController?.initialize();
    } else {
      throw Exception(PackageStrings.throwErrorControllerInitialization);
    }
  } else {
    throw Exception(PackageStrings.throwErrorCameraAvailability);
  }
}

Controller Can be Initialized in page initialization OR triggered by a trigger such as tapping on a Button:

  void onInit() {
  _controllerInitialization();
  super.initState();
}

OR

Button(onPressed: () => _controllerInitialization(), child: Text('Controller Initialization'));

NOTE: In either way, Controller must be initialized before having Scanner Widget.

Using Scanner Widget in your Screen:

WebDocumentScanner(scannerController!);

Controller will return the Captured Document:

ScannerResponse scannerResponse = await scannerController!.startAutoScan();

The Status of the Scanner can be controlled by setting the ScannerStatus of the Controller:

ScannerStatus scannerStatus = ScannerStatus.scanning;

You can check the /example for a more complete example, more details and further information. #

Docs #

build

About Author #

Resam Taghipour #

Pub account Pub Pub

Packages and Dependencies #

Pub Pub Pub Pub Pub

License #

This project is licensed under the 'BSD-3-Clause' License - see the LICENSE for details.

Pub

1
likes
140
points
172
downloads

Publisher

verified publisherresam.site

Weekly Downloads

Web Document Scanner Example

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

resam.site

License

BSD-3-Clause (license)

Dependencies

camera, dartdoc, dartz, flutter, image, permission_handler

More

Packages that depend on web_document_scanner