scanny 0.1.0

Scanny - Only for Andorid #

A document scanner plugin for Android. This plugin is a Document scanner which can be used for free. Just add the plugin into your project and start using it

Getting Started #

This plugin is built for android for now. Scan the document and you would get the image of the document

Add the dependency #

    dependencies:
        scanny: ^0.1.0

Install the plugin #

flutter pub get

Usage #

Instantiate Scanny plugin and pass it to any custom widget

For instance #

Instantiate the Scanny plugin 
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState(new Scanny());
}

Scanny provides you with 2 methods #

  1. askPermissions - for asking camera and storage permissions
  2. callScanner - This will instiate the scanner activity of the android

askPermissions is straight forward to use #

For instance #

      Future<void> askPermissions() async {
        await scanny.askPermissions;
      }

callScanner usage #

Use this method to initiate the scanning activity

 dynamic _imageBytes;
 Future<void> scanDocument() async {
    try {
      //ask permissions if permissions are not granted yet
      await askPermissions();
      //call the scanner
       scanny.callScanner;
       //listen to the results of activity
       scanny.getImageBytes.listen((imageBytes){
         setState(() {
           _imageBytes = imageBytes;
         });
       });
    }
    catch(error) {
      print(error);
    }
  }

Results - #

We get the image results in the form of imageBytes so we store them in dynamic datatype for the sake of simplicity

 scanny.getImageBytes.listen((imageBytes){
         setState(() {
           _imageBytes = imageBytes;
         });
       });

Displaying the results in Flutter #

Displaying of the returned images can be done using Image.memory widget.

For instance #

Image.memory(_imageBytes)

For more info - Refer example folder under this repo #

The example flutter contains main.dart file. Please refer if get stuck along the way or ping me so that I can look into it.

For contributions #

Do Create pull and contribute. If you face any issues, please to create an issue.

TODO #

  1. Add IOS scanner (Major)
  2. Add passport scanning functionality

Thanks #

I would really like to thank

  1. https://github.com/Credntia/CVScanner for this wonderful scanner
  2. https://github.com/Diastorm/rn-doc-scanner-android

License #

GNU General Public License v3.0 Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.

0.1.0 #

Flutter Document Scaanner for Android #

This is an initial unstable release for scanning documents

example/README.md

scanny_example #

Demonstrates how to use the scanny plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  scanny: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:scanny/scanny.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
40
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Feb 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health issues and suggestions

Document public APIs. (-1 points)

11 out of 11 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/scanny.dart. (-0.50 points)

Analysis of lib/scanny.dart reported 1 hint:

line 2 col 8: Unused import: 'dart:io'.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test