A Flutter plugin for iOS that enables native text selection on images using iOS Live Text API.
- Live Text Support (iOS 15+): Automatic text detection and selection
- Zoom Support: Pinch-to-zoom and double-tap zoom (up to 5x)
- Auto Text Detection: Shows "No text found" toast if no text detected (iOS 16+)
- Graceful Fallback (iOS 12-14): Shows compatibility message
- Full-Screen Viewer: Black background, minimal UI
- Multiple Sources: File, asset, and network images
- iOS 12.0 or higher
- Live Text features require iOS 15.0+
- Flutter 3.3.0 or higher
Add to your pubspec.yaml:
dependencies:
native_text_viewer: ^1.0.0Add the following permissions to your iOS app's Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photo library to select images for text detection</string>
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to take photos for text detection</string>import 'package:native_text_viewer/native_text_viewer.dart';
// Display image with Live Text
NativeTextImageViewer(
imagePath: '/path/to/image.jpg',
source: ImageSource.file,
)// Check if Live Text is supported
bool isSupported = await NativeTextViewer.isLiveTextSupported();
// Get iOS version
String? version = await NativeTextViewer.getIOSVersion();// From file
NativeTextImageViewer(
imagePath: '/path/to/image.jpg',
source: ImageSource.file,
)
// From assets
NativeTextImageViewer(
imagePath: 'assets/images/receipt.png',
source: ImageSource.asset,
)
// From network
NativeTextImageViewer(
imagePath: 'https://example.com/image.jpg',
source: ImageSource.network,
)cd example
flutter runFeatures image picker (gallery/camera) with full-screen viewer.
iOS 15+:
- Long press to select text
- Pinch to zoom / double-tap zoom
- Copy, translate, look up definitions
- Tap detected phone numbers, emails, URLs
iOS 16+:
- Shows "No text found" if no text detected
| Platform | Support |
|---|---|
| iOS | ✅ (12.0+) |
| Android | ❌ |
| Web | ❌ |
| macOS | ❌ |
| Windows | ❌ |
| Linux | ❌ |
- iOS only (12.0+)
- Live Text requires iOS 15.0+
- "No text found" toast requires iOS 16.0+
MIT