Attribute Localizations delivers a prepeard localizations labels for most used attributes.
Getting Started
- Add to your dependencies:
dependencies:
attribute_localization:
url: git://github.com/hsul4n/flutter-localizations.git
path: packages/attribute_localization
- Add delegates in your
MaterialApp
widget:
MaterialApp(
// ...
localizationsDelegates: [
AttributeLocalizations.delegate,
],
supportedLocales: [
const Locale('en'),
const Locale('ar'),
/// add other locales for now (en, ar)
],
// ...
)
- Use it:
/// ...
TextFormField(
decoration: InputDecoration(
labelText: AttributeLocalizations.of(context).name,
// figer out more, AttributeLocalizations.of(context).email, etc..
),
)
/// ..