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
DateFormat pattern for a full Gregorian day.
final
gregorianMonthPattern String
DateFormat pattern for month granularity.
final
gregorianYearPattern String
DateFormat pattern 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 dateTime for the given calendarKind and granularity.
formatRange(DateTimeRange<DateTime>? range, {required UnifiedFieldsCalendarKind calendarKind, UnifiedFieldsDatePickerGranularity granularity = UnifiedFieldsDatePickerGranularity.day}) String
Formats range using 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 via PersianJalaliCalendar).