google_translate 0.0.6 copy "google_translate: ^0.0.6" to clipboard
google_translate: ^0.0.6 copied to clipboard

Google Translate API for Dart. Dynamically Translate Between Thousands of Languages

Google translate #

pub package travis

Google Translate API for Dart.

Usage #

Add google_translate to your pubspec:

dependencies:
  google_translate: any # or the latest version on Pub

Configure it in you Flutter app.

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  GoogleTranslate.initialize(
    apiKey: "you api key",
    sourceLanguage: "en",
    targetLanguage: "it",
  )

  runApp(const MyApp());
}

Use it

'example'.translate().then((value) {
    setState(() {
        title = value;
    });
});

or

'esempio'.translate(sourceLanguage: 'it', targetLanguage: 'en').then((value) {
    setState(() {
        title = value;
    });
});

Run the example #

See the example/ folder for a working example app.

Supporting Me #

A donation through my Ko-Fi page would be infinitly appriciated: ko-fi

but, if you can't or won't, a star on GitHub and a like on pub.dev would also go a long way!

Every donation gives me fuel to continue my open-source projects and lets me know that I'm doing a good job.

15
likes
140
points
887
downloads

Publisher

unverified uploader

Weekly Downloads

Google Translate API for Dart. Dynamically Translate Between Thousands of Languages

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dio, dio_cache_interceptor, dio_cache_interceptor_hive_store, flutter, path_provider

More

Packages that depend on google_translate