l10n_flutter 1.0.5 copy "l10n_flutter: ^1.0.5" to clipboard
l10n_flutter: ^1.0.5 copied to clipboard

outdated

This single framework will help you localize your Flutter application without the headache.

example/README.md


import 'package:flutter/cupertino.dart';
import 'package:l10n_flutter/l10n_material_app.dart';

import 'models/l10n.dart';
import 'l10n_widget_helper.dart';

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

  @override
  _MaterialAppDemoState createState() => _MaterialAppDemoState();
}

class _MaterialAppDemoState extends State<MaterialAppDemo> {
  Locale? _locale = const Locale('he', 'IL');

  void changeLocale(Locale? newLocale) async {
    await l10nSettings.selectLocale(newLocale);
    setState(() {
      _locale = newLocale;
    });
  }

  @override
  void initState() {
    changeLocale(_locale);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return L10nMaterialApp(
      locale: _locale, // Dynamic locale
      supportedLocales: l10nSettings.supportedLocales, // Provide a list of supported locales
      home: WidgetHelper.createMaterialScaffold(context, l10nSettings.indexOf(_locale), changeLocale),
    );
  }
}
void main() => runApp(const MaterialAppDemo());

Examples #

https://github.com/dgofman/l10n_flutter/tree/main/lib/examples

See Also #

6
likes
0
points
719
downloads

Publisher

verified publishersoftigent.com

Weekly Downloads

This single framework will help you localize your Flutter application without the headache.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

build, cupertino_icons, flutter, flutter_localizations

More

Packages that depend on l10n_flutter