scanify_web 0.0.2
scanify_web: ^0.0.2 copied to clipboard
Scanify Web Document Scanner
Scanify Web Document Scanner
A Flutter Package to Scan Document on WEB.
Contents: #
Getting Started #
Add dependencies in the pubspec.yaml:
dependencies:
scanify_web: ^latest
Get the Changes by:
flutter pub get
or
dart pub get
Usage #
import 'package:scanify_web/scanify_web.dart';
ScanifyController must be initialized:
void _controllerInitialization() async {
scanifyStatus = ScanifyStatus.initializing;
final List<CameraDescription> cameras = await availableCameras();
if (cameras.isNotEmpty) {
final CameraDescription selectedCamera = cameras.first;
scanifyController = ScanifyController(description: selectedCamera);
if (scanifyController != null) {
await scanifyController?.initialize();
} else {
throw Exception(PackageStrings.throwErrorControllerInitialization);
}
} else {
throw Exception(PackageStrings.throwErrorCameraAvailability);
}
}
ScanifyController 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('ScanifyController Initialization'));
NOTE: In either way,
ScanifyControllermust be initialized before havingScannerWidget.
Using Scanner Widget in your Screen:
ScanifyWebScanner(scanifyController!);
Controller will return the Captured Document:
ScanifyResponse scanifyResponse = await scanifyController!.startAutoScan();
The Status of the Scanify can be controlled by setting the ScanifyStatus of the ScanifyController:
ScanifyStatus scanifyStatus = ScanifyStatus.scanning;
You can check the /example for a more complete example, more details and further information. #
Docs #
About Author #
Resam Taghipour #
Packages and Dependencies #
License #
This project is licensed under the 'BSD-3-Clause' License - see the LICENSE for details.