Date class

Date class that wraps DateTime.

Constructors

Date(int year, int month, int day)
Constructs a Date instance, refer to DateTime to more information.
Date.of(DateTime dateTime)
Constructs a new Date instance based on dateTime.
Date.today()
Constructs a Date instance with current date.

Properties

dateTime DateTime
The DateTime that wraps this class.
final
day int
Refer to DateTime for more information.
no setter
hashCode int
Refer to DateTime for more information.
no setteroverride
lastDayOfMonth int
Returns the last day of this Date month.
no setter
month int
Refer to DateTime for more information.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weekday int
Refer to DateTime for more information.
no setter
year int
Refer to DateTime for more information.
no setter

Methods

add(Duration duration) Date
Refer to DateTime for more information.
compareTo(Date other) int
Refer to DateTime for more information.
copyWith({int? year, int? month, int? day}) Date
Refer to DateTime for more information.
difference(Date other) Duration
Refer to DateTime for more information.
isAfter(Date other) bool
Refer to DateTime for more information.
isBefore(Date other) bool
Refer to DateTime for more information.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subtract(Duration duration) Date
Refer to DateTime for more information.
toString() String
Returns a human-readable string for this instance.
override

Operators

operator ==(Object other) bool
Returns true if other is a Date at the same date.
override

Constants

daysPerWeek → const int
friday → const int
monday → const int
saturday → const int
sunday → const int
thursday → const int
tuesday → const int
wednesday → const int