google_mlkit_language_id
1.0.3, released 8 days ago by flutter-ml.dev
Determine the language of a text string using Google's ML Kit.
What it does
A Flutter plugin that uses Google's native ML Kit Language Identification APIs via platform channels. It lets you identify the single most likely language for a string of text or get a list of possible languages with confidence scores.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to detect the language of user input on mobile devices.
- You want on-device language identification without sending text to a cloud server.
Skip it when
- You are targeting web or desktop platforms, which are not supported.
- You require a solution written purely in Dart without native mobile dependencies.
Strengths
- Leverages Google's proven on-device native ML Kit library.
- Supports confidence thresholds and multiple possible language identifications.
Weaknesses
- Mobile only (Android and iOS); web and desktop are not supported.
- Requires platform-specific setup (such as setting iOS deployment target to 15.0 and adding linker flags).
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
For iOS, set minimum deployment target to 15.0 and add `-ObjC` and `-all_load` to Other Linker Flags. For Android, ensure `minSdkVersion` is at least 21.
final languageIdentifier = LanguageIdentifier(confidenceThreshold: 0.5);
final String response = await languageIdentifier.identifyLanguage(text);
languageIdentifier.close();Alternatives
Packages that do the same job and could replace google_mlkit_language_id.
- flutter_litert_lm
Run Large Language Models on-device using Google's LiteRT-LM runtime.
47Compare
Works with
Packages commonly used together with google_mlkit_language_id: ones it builds on, ones built on it, and its own family.
- google_mlkit_commonsSame familyCommon classes and utility methods for Google's ML Kit plugins
- google_mlkit_text_recognitionSame familyFlutter plugin to use Google's ML Kit Text Recognition on Android and iOS.
- google_mlkit_barcode_scanningSame familyA Flutter plugin to use Google's ML Kit Barcode Scanning on Android and iOS.
- google_mlkit_face_detectionSame familyFlutter plugin to use Google's ML Kit Face Detection on iOS and Android.
- google_mlkit_translationSame familyFlutter plugin for Google's ML Kit On-Device Translation.
- google_mlkit_selfie_segmentationSame familyFlutter plugin to use Google's ML Kit Selfie Segmentation API.
- google_mlkit_pose_detectionSame familyFlutter plugin for Google ML Kit Pose Detection on Android and iOS.
- google_mlkit_document_scannerSame familyFlutter plugin to use Google's ML Kit document scanner API to digitize physical documents.