flutter_language_identification 0.1.0 copy "flutter_language_identification: ^0.1.0" to clipboard
flutter_language_identification: ^0.1.0 copied to clipboard

A flutter plugin for language identification using Google's ML Kit. This plugin is supported on iOS and Android.

Language Identification #

pub package

A flutter plugin to identify language using Google's ML Kit. (Swift,Java)

Features #

  • Android, iOS
    • identify language
    • identify possible languages

To use this plugin :

iOS #

Google's ML Kit requires a minimum deployment target of 10.0. You can add the line platform :ios, '10.0' in your iOS project Podfile.

You may also need to update your app's deployment target to 10.0 using Xcode. Otherwise, you may see compilation errors.

Flutter #

  • add the dependency to your pubspec.yaml
  dependencies:
    flutter:
      sdk: flutter
    flutter_language_identification:
  • instantiate FlutterLanguageIdentification
FlutterLanguageIdentification languageIdentification = FlutterLanguageIdentification();

identifyLanguage, identifyPossibleLanguages #

Future _identifyLanguage() async{
    await languageIdentification.identyLanguage("Hello World");
}

Future _identifyPossibleLanguages() async{
    await languageIdentification.identifyPossibleLanguages("Hello World");
}

Listening for platform calls to receive results #

languageIdentification.setSuccessHandler((message) {
    setState(() {
    print(message);
    _result = message;
    });
});

languageIdentification.setErrorHandler((message) {
    setState(() {
    print(message);
    });
});

languageIdentification.setFailedHandler((message) {
    setState(() {
    print(message);
    _result = message;
    });
});
8
likes
40
pub points
49%
popularity

Publisher

verified publishertundralabs.com

A flutter plugin for language identification using Google's ML Kit. This plugin is supported on iOS and Android.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_language_identification