FlexiDateData class

A flexible container for date components that provides a robust parsing/building mechanism. If the input type is known to be a String, Map or DateTime, then use the corresponding constructors.

FlexiDateParser.tryFrom will / attempt to construct a FlexibleDate instance, and will return null if none could be constructed. FlexiDateParser.from will / attempt to construct a FlexibleDate instance, and will raise an exception if unable to create a FlexibleDate instance

Implemented types
Available extensions

Constructors

FlexiDateData({int? day, int? month = 1, int? year, Object? source, bool isAmbiguous = false})
FlexiDateData.fromDateTime(DateTime dateTime)
FlexiDateData.fromMap(Map toParse)
from a map, assuming keys kday, kmonth, kyear
FlexiDateData.now()
factory

Properties

day ↔ int?
getter/setter pairoverride
error → String?

Available on FlexiDate, provided by the FlexiDateExt extension

no setter
hasDay → bool

Available on FlexiDate, provided by the FlexiDateExt extension

no setter
hashCode → int
The hash code for this object.
no setteroverride
hasMonth → bool

Available on FlexiDate, provided by the FlexiDateExt extension

no setter
hasYear → bool

Available on FlexiDate, provided by the FlexiDateExt extension

no setter
isAmbiguous ↔ bool
getter/setter pairoverride-getter
isFullDate → bool

Available on FlexiDate, provided by the FlexiDateExt extension

no setter
isFuture → bool

Available on FlexiDate, provided by the FlexiDateExt extension

Whether this date is in the future
no setter
isValid → bool
no setteroverride
month ↔ int?
getter/setter pairoverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source ↔ Object?
getter/setter pairoverride-getter
year ↔ int?
getter/setter pairoverride

Methods

copy() → FlexiDate

Available on FlexiDate, provided by the FlexiDateExt extension

isSameMonth(DateTime date) → bool

Available on FlexiDate, provided by the DateComponentsComparisons extension

millisecondsSinceEpoch([Location? location]) → int

Available on FlexiDate, provided by the FlexiDateExt extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDateTime([Location? location]) → DateTime

Available on FlexiDate, provided by the FlexiDateExt extension

toJson() → dynamic
override
toMap() → Map<String, int?>
toString() → String
A string representation of this object.
override
withoutDay() → FlexiDate

Available on FlexiDate, provided by the FlexiDateExt extension

withoutYear() → FlexiDate

Available on FlexiDate, provided by the FlexiDateExt extension

Operators

operator ==(Object other) → bool
The equality operator.
override