Skip to main content

l10n_plus_flutter 0.1.0 copy "l10n_plus_flutter: ^0.1.0" to clipboard
l10n_plus_flutter: ^0.1.0 copied to clipboard

Flutter integration for l10n_plus, with a locale controller, a scope widget and a BuildContext extension.

l10n_plus_flutter #

Flutter integration for l10n_plus.

void main() => runApp(
  L10nScope(
    controller: createAppLocalizationsController(),
    child: const App(),
  ),
);

class Screen extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Text(context.l10n.auth.login.title);
}

What it adds:

  • L10nController — the single source of truth for the active locale. setLocale is synchronous, because nothing is loaded asynchronously in generated mode.
  • L10nScope — an InheritedNotifier that rebuilds dependents on a change.
  • context.l10n — the generated extension, named by context_extension in your configuration.
  • Locale interop, and system-locale following.

There is deliberately no LocalizationsDelegate: L10nScope is already a single source of truth, and a delegate would create a second path to the same state. Add GlobalMaterialLocalizations.delegates for Flutter's own widgets — that is not this package's job.

Full guide and design notes: the repository README and docs/architecture.md.

0
likes
160
points
375
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter integration for l10n_plus, with a locale controller, a scope widget and a BuildContext extension.

Repository (GitHub)
View/report issues

Topics

#localization #i18n #l10n #translation #flutter

License

MIT (license)

Dependencies

flutter, l10n_plus

More

Packages that depend on l10n_plus_flutter