パッケージ、リポジトリ、アプリカテゴリを検索

flutter_doc_scanner のカバー
パッケージ詳細v0.0.21

flutter_doc_scanner

ML Kit ドキュメントスキャナ API および VisionKit を使用して、Android および iOS でのドキュメントスキャン用の Flutter プラグイン。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2.7万
いいね数
166
Pub ポイント
140

パッケージをインストール

flutter pub add flutter_doc_scanner

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

GoogleのML KitドキュメントスキャナAPIとAppleのVisionKitを活用して、AndroidおよびiOSで文書スキャンを可能にするFlutterプラグインです。画像から文書のエッジをキャプチャし、検出するためのシームレスな方法を提供し、自動的にクロップして文書を強化します。Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、文書のデジタル化が必要なクロスプラットフォームアプリケーションに最適です。統合の容易さを重視して構築されており、ネイティブコードの深い知識なしに、スマートな文書スキャン機能を簡単に追加できます。

用途

  • モバイルアプリにおける文書のデジタル化
  • 自動化された請求書および領収書のスキャン
  • ID確認付きのオンボーディングワークフロー
  • スキャンされた文書からのPDF生成
  • モバイルバンキングとフォーム処理

主な機能

  • 正確な検出に ML Kit と VisionKit を使用
  • すべての主要OSにおけるクロスプラットフォーム対応
  • 画像のキャプチャおよび処理のためのシンプルな API
  • 自動エッジ検出とクロップ
  • Android および iOS の両方をネイティブパフォーマンスでサポート

適している対象

  • ドキュメントが多く含まれるアプリを開発する開発者
  • 迅速なオンボーディングが必要なスタートアップ
  • OCR対応スキャンを必要とするアプリ
  • Flutter を使用するクロスプラットフォームチーム
  • 企業が書類作成を自動化

注意事項

  • モバイルデバイスでのカメラ権限が必要です
  • 古いデバイスではパフォーマンスが異なる場合があります
  • Webのサポートはブラウザの機能に依存します
  • スキャンUIのカスタマイズが限定的
  • 外部SDK(ML Kit、VisionKit)に依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

flutter_doc_scanner

A Flutter plugin for document scanning on Android, iOS, and Web 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.
  • Ability to set a scan page limit.
  • Support for image(png,jpeg) format and PDF has been added through various methods.
  • Fast single-picture scanning mode via useAutomaticSinglePictureProcessing for quick one-document captures.

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.21

Got it! Here's a more detailed explanation:

Usage

Use the following function for document scanning on Android and iOS:

  Future<void> scanDocument() async {
  //by default way they fetch pdf for android and png for iOS
  dynamic scannedDocuments;
  try {
    scannedDocuments = await FlutterDocScanner().getScanDocuments(page: 3) ??
        'Unknown platform documents';
  } on PlatformException {
    scannedDocuments = 'Failed to get scanned documents.';
  }
  print(scannedDocuments.toString());
}

Note-: If you want to obtain only a PDF scanned document, call getScannedDocumentAsPdf(). Similarly, if you want to get a scanned document in image format, use getScannedDocumentAsImages().

Android result payloads
  • getScanDocuments / getScannedDocumentAsPdf: returns a map with pdfUri and pageCount.
  • getScannedDocumentAsImages / getScanDocumentsUri: returns a map with images (list of page URIs) and count (also exposed via legacy Uri / Count keys for backwards compatibility).

Project Setup

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

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
Web

Currently, we have removed web support for this library. For document scanning on the web, you can use the following library: flutter_doc_scanner_web.

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.

カテゴリー

依存関係

依存関係一覧 1 件

  • plugin_platform_interface^2.0.2

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。