i18n_plus 0.8.1 copy "i18n_plus: ^0.8.1" to clipboard
i18n_plus: ^0.8.1 copied to clipboard

unlistedoutdated

Helps you to implement different languages in your app with ease.

i18n-plus #

Features #

  • helps you implementing different languages to your app!
  • set the language for the i18nTextfields with one call!
  • provides easy and effortless live-changing of current languages
  • i18nText is as customizeable as the original Text Widget
  • checks if your languagesets are consistent

Example #

Simplified Implementation

import 'package:flutter/material.dart';
import 'package:i18n_plus/i18n.dart';
import 'package:i18n_plus/i18nMap.dart';
import 'package:i18n_plus/i18nText.dart';

main() {
  runApp(MaterialApp(home: Example()));
}

class Example extends StatefulWidget {
  Example({Key key}) : super(key: key);
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  I18NMap map = I18NMap({
    Locale('en', 'Us'): {"greeting": "Hello"},
    Locale('de', 'De'): {"greeting": "Hallo"},
    Locale('fr', 'Fr'): {"greeting": "Bonjour"}
  });
  I18N i18n = I18N();

  @override
  void initState() {
    i18n.seti18nMap(map);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Column(children: [
      Container(
          child: I18NText(
        i18nKey: "greeting",
        additionalString: " Flutter Dev!",
      )),
      DropdownButton<Locale>(
        items: i18n.allLocale().map((Locale value) {
          return new DropdownMenuItem<Locale>(
            value: value,
            child: new Text(value.toLanguageTag()),
          );
        }).toList(),
        onChanged: (value) {
          i18n.setCurrentLocale(value);
        },
      )
    ]));
  }
}
1
likes
0
pub points
0%
popularity

Publisher

verified publisherljb-dev.com

Helps you to implement different languages in your app with ease.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on i18n_plus