Skip to content
pubscout

google_mlkit_translation

1.0.3, released 8 days ago by flutter-ml.dev

Flutter plugin for Google's ML Kit On-Device Translation.

$ flutter pub add google_mlkit_translation
Source repository

What it does

A Flutter plugin that uses Google's ML Kit On-Device Translation to dynamically translate text between more than 50 languages. It provides APIs to run translation locally on the device and manage the required language models.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need offline or on-device text translation between multiple languages.
  • You want to avoid sending sensitive user text to a remote translation API.

Skip it when

  • You need translation support on the web platform.
  • You want an easy Dart-only localization solution for static app strings.

Strengths

  • Performs translation entirely on-device without needing internet connectivity during runtime.
  • Supports over 50 languages using native Google ML Kit APIs.

Weaknesses

  • Does not support the web platform.
  • Requires manual native configuration and model management.

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Requires minimum iOS deployment target 15.0 with Swift Package Manager setup, linker flags (-ObjC, -all_load), and downloading MLKitTranslate_resource.bundle. Android requires minSdkVersion 21 and compileSdkVersion 36.

final onDeviceTranslator = OnDeviceTranslator(sourceLanguage: TranslateLanguage.english, targetLanguage: TranslateLanguage.spanish);
final String response = await onDeviceTranslator.translateText('Hello world');
onDeviceTranslator.close();

Alternatives

Packages that do the same job and could replace google_mlkit_translation.

  • intl

    For static app localization and message formatting without heavy on-device machine learning models.

  • flutter_localization

    For built-in Flutter localization support across different locales.

Works with

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