flutter_l10n 1.1.2
flutter_l10n: ^1.1.2 copied to clipboard
A dart library that generates Flutter localization code from ARB file.
flutter_l10n #
A dart library that generates Flutter localization code from ARB file.
This library is an extension of official Flutter localizations. You can refer to 👉here👈 to config the flutter_l10n.yaml.
Features #
- Compatible with official APIs.
- Support multiple packages/modules.
- Support using without
context.
Getting Started #
Install / Update #
dart pub global activate flutter_l10n
Usage #
-
Generate
S.dartfile from*.arbfiles in your project directory by running:flutterl10n. -
Register in
MaterialApp/WidgetsApp:
MaterialApp(
localizationsDelegates: [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
);
- Reference strings by
S.of(context).helloWorldorS.current.helloWorld.