flutter_image_to_text_button 1.0.0 copy "flutter_image_to_text_button: ^1.0.0" to clipboard
flutter_image_to_text_button: ^1.0.0 copied to clipboard

A Flutter package to extract text from image using OCR.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_image_to_text_button/flutter_image_to_text_button.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ImageToTextButton Demo',
      home: Scaffold(
        appBar: AppBar(title: const Text('ImageToTextButton Example')),
        body: Center(
          child: ImageToTextButton(
            buttonText: 'Pick Image & Extract Text',
            onTextExtracted: (String text) {
              showDialog(
                context: context,
                builder: (_) => AlertDialog(
                  title: const Text('Extracted Text'),
                  content: SingleChildScrollView(child: Text(text)),
                  actions: [
                    TextButton(
                      onPressed: () => Navigator.pop(context),
                      child: const Text('OK'),
                    ),
                  ],
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
32
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package to extract text from image using OCR.

Homepage

License

unknown (license)

Dependencies

flutter, google_mlkit_text_recognition, image_picker, path_provider

More

Packages that depend on flutter_image_to_text_button