learning_language 0.0.4 copy "learning_language: ^0.0.4" to clipboard
learning_language: ^0.0.4 copied to clipboard

The easy way to use ML Kit for identifying languages in Flutter.

ML Language #

The easy way to use ML Kit for identifying languages in Flutter.

With ML Kit's on-device language identification, we can determine the language of a string of text. Language identification can be useful when working with user-provided text, which often doesn't come with any language information.

Getting Started #

Add dependency to your flutter project:

$ flutter pub add learning_language
copied to clipboard

or

dependencies:
  learning_language: ^0.0.3+2
copied to clipboard

Then run flutter pub get.

Usage #

import 'package:learning_language/learning_language.dart';
copied to clipboard

Identify Language #

String text = 'Baby, you light up my world like nobody else';
LanguageIdentifier identifier = LanguageIdentifier();
String language = await identifier.identify(text);
print(language);
copied to clipboard

Identify Possible Languages #

String text = 'Baby, you light up my world like nobody else';
LanguageIdentifier identifier = LanguageIdentifier();
List<IdentifiedLanguage> possibleLanguages = await identifier.idenfityPossibleLanguages(text);

String languages = possibleLanguages.map((item) => item.language).toList().join(', ');

print('Possible Languages: $languages');
copied to clipboard

Dispose #

identifier.dispose();
copied to clipboard

Example Project #

You can learn more from example project here.

10
likes
150
points
65
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.08 - 2025.03.23

The easy way to use ML Kit for identifying languages in Flutter.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on learning_language