auto_localization 2.0.2 copy "auto_localization: ^2.0.2" to clipboard
auto_localization: ^2.0.2 copied to clipboard

This is a project to automatically translate your app in any language.

example/lib/main.dart

import 'package:auto_localization/auto_localization.dart';
import 'package:flutter/material.dart';

class TranslateATextExample extends StatefulWidget {
  const TranslateATextExample({Key? key}) : super(key: key);

  @override
  State<TranslateATextExample> createState() => _TranslateATextExampleState();
}

class _TranslateATextExampleState extends State<TranslateATextExample> {
  @override
  Widget build(BuildContext context) {
    return AutoLocalBuilder(
      text: const ["ciao", "come stai?"], // Set the list of text you need to translate
      builder: (TranslationWorker tw) {
        print(tw.get('ciao')); //Use the same text to get its translation
        print(tw.get('come stai?'));
        return Text(tw.get('ciao'),); //Retrieve it and show with a Text or whatever you need
      },
    );
  }
}
14
likes
120
pub points
71%
popularity

Publisher

verified publishersipio.it

This is a project to automatically translate your app in any language.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, hive, hive_flutter, synchronized, translator

More

Packages that depend on auto_localization