flutter_image_to_text_button 1.0.0
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'),
),
],
),
);
},
),
),
),
);
}
}