Skip to content
pubscout

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.

WASM-ready
$ flutter pub add google_mlkit_language_id
Source repository

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.

Works with

Packages commonly used together with google_mlkit_language_id: ones it builds on, ones built on it, and its own family.