FLocalizations class abstract
Callers can lookup localized strings with an instance of FLocalizations
returned by FLocalizations.of(context).
Applications need to include FLocalizations.delegate() in their app's
localizationDelegates list, and the locales they support in the app's
supportedLocales list. For example:
import 'localizations/localizations.dart';
return MaterialApp(
localizationsDelegates: FLocalizations.localizationsDelegates,
supportedLocales: FLocalizations.supportedLocales,
home: MyApplicationHome(),
);
Update pubspec.yaml
Please make sure to update your pubspec.yaml to include the following packages:
dependencies:
# Internationalization support.
flutter_localizations:
sdk: flutter
intl: any # Use the pinned version from flutter_localizations
# Rest of dependencies
iOS Applications
iOS applications define key application metadata, including supported locales, in an Info.plist file that is built into the application bundle. To configure the locales supported by your app, you’ll need to edit this file.
First, open your project’s ios/Runner.xcworkspace Xcode workspace file. Then, in the Project Navigator, open the Info.plist file under the Runner project’s Runner folder.
Next, select the Information Property List item, select Add Item from the Editor menu, then select Localizations from the pop-up menu.
Select and expand the newly-created Localizations item then, for each locale your application supports, add a new item and select the locale you wish to add from the pop-up menu in the Value field. This list should be consistent with the languages listed in the FLocalizations.supportedLocales property.
- Implementers
- Available extensions
Constructors
- FLocalizations(String locale)
Properties
- autocompleteNoResults → String
-
The message displayed when there are no matching results.
no setter
- barrierLabel → String
-
The label for the barrier rendered underneath the content of a bottom sheet (used as the 'modalRouteContentName' of the 'barrierOnTapHint' message).
no setter
- calendarNextMonthSemanticsLabel → String
-
The label for the calendar header's next-month navigation button.
no setter
- calendarNextYearSemanticsLabel → String
-
The label for the calendar header's next-year navigation button.
no setter
- calendarNextYearsSemanticsLabel → String
-
The label for the calendar header's next-years navigation button.
no setter
- calendarPreviousMonthSemanticsLabel → String
-
The label for the calendar header's previous-month navigation button.
no setter
- calendarPreviousYearSemanticsLabel → String
-
The label for the calendar header's previous-year navigation button.
no setter
- calendarPreviousYearsSemanticsLabel → String
-
The label for the calendar header's previous-years navigation button.
no setter
- contextMenuSemanticsLabel → String
-
The semantic label for a context menu.
no setter
- dateFieldHint → String
-
The hint text for the calendar-only date field.
no setter
- dateFieldInvalidDateError → String
-
Error message displayed to the user when they have entered a text string in a time field that is not in a valid time format.
no setter
- dateTimePickerToday → String
-
The label for today's date in the date time picker.
no setter
- dialogSemanticsLabel → String
-
The sheet's label.
no setter
- firstDayOfWeek → int
-
Available on FLocalizations, provided by the FDateTimeLocalizations extension
The first day of the week, in ISO 8601 style, where the first day of the week, i.e. index 1, is Monday.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- localeName → String
-
final
- multiSelectHint → String
-
The hint text for the multi-select field.
no setter
-
narrowWeekDays
→ List<
String> -
Available on FLocalizations, provided by the FDateTimeLocalizations extension
Very short names for days of the week, starting with Sunday, e.g. 'Su'.no setter - paginationNextSemanticsLabel → String
-
The label for the next button in a pagination control.
no setter
- paginationPreviousSemanticsLabel → String
-
The label for the previous button in a pagination control.
no setter
- passwordFieldLabel → String
-
The password text field's label.
no setter
- passwordFieldObscureTextButtonSemanticsLabel → String
-
The semantic label for the unobscure text button in a text field when the text is obscured.
no setter
- passwordFieldUnobscureTextButtonSemanticsLabel → String
-
No description provided for @passwordFieldUnobscureTextButtonSemanticsLabel.
no setter
- popoverSemanticsLabel → String
-
The semantic label for a popover.
no setter
- progressSemanticsLabel → String
-
The default semantics label for a progress indicator.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectHint → String
-
The hint text for the select field.
no setter
- selectNoResults → String
-
The message displayed when there are no matching results.
no setter
- selectScrollDownSemanticsLabel → String
-
The semantic label for the scroll handle in a select field.
no setter
- selectScrollUpSemanticsLabel → String
-
The semantic label for the scroll handle in a select field.
no setter
- selectSearchHint → String
-
The hint text for the search field in a select field.
no setter
- sheetSemanticsLabel → String
-
The semantic label for a sheet.
no setter
- shortDateSeparator → String
-
The short date's separator, typically /.
no setter
- shortDateSuffix → String
-
The short date's suffix, typically empty.
no setter
-
shortWeekDays
→ List<
String> -
Available on FLocalizations, provided by the FDateTimeLocalizations extension
Short names for days of the week, starting with Sunday, e.g. 'Sun'.no setter - textFieldClearButtonSemanticsLabel → String
-
The semantic label for the clear button in a text field.
no setter
- textFieldEmailLabel → String
-
The email text field's label.
no setter
- timeFieldHint → String
-
The hint text for the picker-only time field.
no setter
- timeFieldInvalidDateError → String
-
No description provided for @timeFieldInvalidDateError.
no setter
- timeFieldPeriodSeparator → String
-
The time field's period separator, typically ' '.
no setter
- timeFieldSuffix → String
-
The time field's suffix, typically none.
no setter
- timeFieldTimeSeparator → String
-
The time field's time separator, typically ':'.
no setter
Methods
-
barrierOnTapHint(
String modalRouteContentName) → String - The onTapHint for the barrier rendered underneath the content of a modal route (especially a sheet) which users can tap to dismiss the content.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → FLocalizations?
Constants
-
delegate
→ const LocalizationsDelegate<
FLocalizations> -
localizationsDelegates
→ const List<
LocalizationsDelegate> - A list of this localizations delegate along with the default localizations delegates.
-
supportedLocales
→ const List<
Locale> - A list of this localizations delegate's supported locales.