Coder Social home page Coder Social logo

unluckyy1 / flutter_doc_scanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shirsh94/flutter_doc_scanner

0.0 0.0 0.0 26.87 MB

License: MIT License

Ruby 1.77% C++ 34.89% C 3.28% Objective-C 0.82% Kotlin 9.72% Dart 12.06% Swift 6.46% HTML 2.04% CMake 28.95%

flutter_doc_scanner's Introduction

flutter_doc_scanner

A Flutter plugin for document scanning on Android and iOS using ML Kit Document Scanner API and VisionKit.

pub package

Example

Check out the example directory for a sample Flutter app using flutter_doc_scanner.

Document Scanner Demo

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3
Screenshot 4 Screenshot 5 Screenshot 6

Features

  • High-quality and consistent user interface for digitizing physical documents.
  • Accurate document detection with precise corner and edge detection for optimal scanning results.
  • Flexible functionality allows users to crop scanned documents, apply filters, remove fingers, remove stains and other blemishes.
  • On-device processing helps preserve privacy.
  • Support for sending digitized files in PDF and JPEG formats back to your app.

Installation

To use this plugin, add flutter_doc_scanner as a dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter
  flutter_doc_scanner: ^0.0.7

Got it! Here's a more detailed explanation:

Project Setup

Follow the steps below to set up your Flutter project on Android and iOS.

Android

Minimum Version Configuration

Ensure you meet the minimum version requirements to run the application on Android devices. In the android/app/build.gradle file, verify that minSdkVersion is at least 21. This setting specifies the minimum Android API level required to run your app, ensuring compatibility with a wide range of Android devices.

android {
    ...
    defaultConfig {
        ...
        minSdkVersion 21
        ...
    }
    ...
}

iOS

Minimum Version Configuration

Ensure you meet the minimum version requirements to run the application on iOS devices. In the ios/Podfile file, make sure the iOS platform version is at least 13.0. This setting specifies the minimum iOS version required to run your app, ensuring compatibility with a wide range of iOS devices.

platform :ios, '13.0'

Permission Configuration

  1. Add a String property to the app's Info.plist file with the key NSCameraUsageDescription and the value as the description for why your app needs camera access. This step is required by Apple to explain to users why the app needs access to the camera, and it's crucial for App Store approval.
  <key>NSCameraUsageDescription</key>
  <string>Camera Permission Description</string>
  1. The permission_handler dependency used by flutter_doc_scanner uses macros to control whether a permission is enabled. To enable camera permission, add the following to your Podfile file. This step ensures that your app can request and handle camera permissions on iOS devices:
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      ... # Here are some configurations automatically generated by flutter

      # Start of the permission_handler configuration
      target.build_configurations.each do |config|

        # You can enable the permissions needed here. For example, to enable camera
        # permission, just remove the `#` character in front so it looks like this:
        #
        # ## dart: PermissionGroup.camera
        # 'PERMISSION_CAMERA=1'
        #
        #  Preprocessor definitions can be found at: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
          '$(inherited)',

          ## dart: PermissionGroup.camera
          'PERMISSION_CAMERA=1',
        ]

      end
      # End of the permission_handler configuration
    end
  end

Usage

import 'package:flutter_doc_scanner/flutter_doc_scanner.dart';

// Use the `FlutterDocScanner` class to start the document scanning process.
dynamic scannedDocuments;
try {
  scannedDocuments = await FlutterDocScanner().getScanDocuments() ??
      'Unknown platform documents';
} on PlatformException {
  scannedDocuments = 'Failed to get scanned documents.';
}
print(scannedDocuments.toString());

Issues and Feedback

Please file issues to send feedback or report a bug. Thank you!

License

The MIT License (MIT) Copyright (c) 2024 Shirsh Shukla

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

flutter_doc_scanner's People

Contributors

shirsh94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.