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.setLocaleis synchronous, because nothing is loaded asynchronously in generated mode.L10nScope— anInheritedNotifierthat rebuilds dependents on a change.context.l10n— the generated extension, named bycontext_extensionin your configuration.Localeinterop, 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.
Libraries
- l10n_plus_flutter
- Flutter integration for
l10n_plusgenerated localizations.