UnifiedFieldsDateFormatStyle class
Display patterns for UnifiedDateField / UnifiedDateRangeField (Gregorian and Shamsi).
Set on UnifiedInputThemeData.dateFormatStyle for a subtree, or override per field
via dateFormatStyle. A legacy DateFormat on valueFormat still wins when set.
- Annotations
Constructors
- UnifiedFieldsDateFormatStyle({String gregorianDayPattern = 'dd,MMM yyyy', String gregorianMonthPattern = 'MMM yyyy', String gregorianYearPattern = 'yyyy', String rangeSeparator = ' – '})
-
Creates date display patterns for both calendar kinds.
const
Properties
- gregorianDayPattern → String
-
DateFormatpattern for a full Gregorian day.final - gregorianMonthPattern → String
-
DateFormatpattern for month granularity.final - gregorianYearPattern → String
-
DateFormatpattern for year granularity.final - hashCode → int
-
The hash code for this object.
no setterinherited
- rangeSeparator → String
-
Separator between start and end in a date range.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
format(
DateTime dateTime, {required UnifiedFieldsCalendarKind calendarKind, UnifiedFieldsDatePickerGranularity granularity = UnifiedFieldsDatePickerGranularity.day}) → String -
Formats a single
dateTimefor the givencalendarKindandgranularity. -
formatRange(
DateTimeRange< DateTime> ? range, {required UnifiedFieldsCalendarKind calendarKind, UnifiedFieldsDatePickerGranularity granularity = UnifiedFieldsDatePickerGranularity.day}) → String -
Formats
rangeusing format for each bound and rangeSeparator. -
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
Constants
- isoGregorianDay → const UnifiedFieldsDateFormatStyle
-
ISO-style Gregorian day:
yyyy-MM-dd. - standard → const UnifiedFieldsDateFormatStyle
-
Built-in patterns (Gregorian
dd,MMM yyyy; Shamsi viaPersianJalaliCalendar).