搜索插件、代码仓与 APP 分类

GitHub 代码仓techvootsolutions/flutter_text_detect_area

flutter_text_detect_area

techvootsolutions/flutter_text_detect_area open-source repository details.

flutter_text_detect_area 项目封面
星标
10
复刻
0
最近推送(UTC)
2026年8月19日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

Flutter Text Detect Area

pub package GitHub stars License: GPLv3 Flutter Compatible Platform


A Flutter plugin that enables text detection from specific areas of an image or live camera preview. Just drag/select the area you want to scan, and let it extract the text using ML Kit.

Perfect for scanning:

  • 🧾 Receipts image
  • 📄 Documents image
  • 📘 PDFs image
  • 🧠 Custom fields in images

🚀 Features

  • 📸 Supports both live camera and gallery image input
  • ✍️ Manual area selection (drag, resize, pan, freeze)
  • 🔁 Detect text once or continuously
  • 📱 Android & iOS support
  • ✅ Simple integration

📦 Installation

Add to your pubspec.yaml:

dependencies:
  flutter_text_detect_area: <latest-version>

Import in your Dart file:

import 'package:flutter_text_detect_area/flutter_text_detect_area.dart';

📸 Preview

Pick Image (GIF) Live Camera (GIF)
Pick Camera
Multi Text Detection (PNG) Single Text Detection Camera (PNG)
Multi Single

📂 Image Picker Setup

Use the image_picker package to choose an image:

final pickedFile = await ImagePicker().pickImage(source: ImageSource.gallery);

✨ Example Usage

Navigator.of(context).push(
  MaterialPageRoute(
    builder: (context) => SelectImageAreaTextDetect(
      detectOnce: true, // Set to false for continuous scan
      enableImageInteractions: true,
      imagePath: pickedFile?.path ?? '',
      onDetectText: (value) {
        if (value is String) {
          print("Detected: $value");
        } else if (value is List<String>) {
          for (int i = 0; i < value.length; i++) {
            print("${i + 1}. ${value[i]}");
          }
        }
      },
      onDetectError: (error) {
        if (error is PlatformException &&
            (error.message?.contains("InputImage width and height should be at least 32!") ?? false)) {
          ScaffoldMessenger.of(context).showSnackBar(
            const SnackBar(content: Text("Selected area must be at least 32x32 pixels.")),
          );
        }
      },
    ),
  ),
);

🔐 Permissions

Android (AndroidManifest.xml)
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
iOS (Info.plist)
<key>NSCameraUsageDescription</key>
<string>Need camera access for live scanning</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Need photo access to pick images</string>

✅ Platform Support

Platform Supported
Android ✅
iOS ✅
Web ❌

🔍 Output Format

  • If detecting once: returns String
  • If detecting multiple areas: returns List<String>

💡 Use Cases

  • Scan receipts for expenses
  • Extract fields from identity cards
  • Detect table content from scanned documents
  • Select and extract from academic papers or books

👨‍💻 Contributors


📄 License

This project is licensed under the GNU GPLv3.

Techvoot Solutions GitHub avatar
GitHub 作者

Techvoot Solutions ↗

A leading software development company. Our services are web and mobile app design & development, custom software, enterprise software system

语言HTMLDartC++CMakeRubySwiftCJavaObjective-CShellKotlin

此仓库发布的插件

使用的依赖

依赖清单 10 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗