Last updated:
0 purchases
google translate
Google translate #
Google Translate API for Dart.
Usage #
Add google_translate to your pubspec:
dependencies:
google_translate: any # or the latest version on Pub
copied to clipboard
Configure it in you Flutter app.
void main() {
WidgetsFlutterBinding.ensureInitialized();
GoogleTranslate.initialize(
apiKey: "you api key",
sourceLanguage: "en",
targetLanguage: "it",
)
runApp(const MyApp());
}
copied to clipboard
Use it
'example'.translate().then((value) {
setState(() {
title = value;
});
});
copied to clipboard
or
'esempio'.translate(sourceLanguage: 'it', targetLanguage: 'en').then((value) {
setState(() {
title = value;
});
});
copied to clipboard
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:
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.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.