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

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 #

7
likes
120
points
767
downloads

Publisher

verified publishersoftigent.com

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

build, cupertino_icons, flutter, flutter_localizations

More

Packages that depend on l10n_flutter