DateUtils class Null safety

Utility functions for working with dates.

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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

addDaysToDate(DateTime date, int days) DateTime
Returns a DateTime with the added number of days and time set to midnight.
addMonthsToMonthDate(DateTime monthDate, int monthsToAdd) DateTime
Returns a DateTime that is monthDate with the added number of months and the day set to 1 and time set to midnight.
dateOnly(DateTime date) DateTime
Returns a DateTime with the date of the original, but time set to midnight.
datesOnly(DateTimeRange range) DateTimeRange
Returns a DateTimeRange with the dates of the original, but with times set to midnight.
firstDayOffset(int year, int month, MaterialLocalizations localizations) int
Computes the offset from the first day of the week that the first day of the month falls on.
getDaysInMonth(int year, int month) int
Returns the number of days in a month, according to the proleptic Gregorian calendar.
isSameDay(DateTime? dateA, DateTime? dateB) bool
Returns true if the two DateTime objects have the same day, month, and year, or are both null.
isSameMonth(DateTime? dateA, DateTime? dateB) bool
Returns true if the two DateTime objects have the same month and year, or are both null.
monthDelta(DateTime startDate, DateTime endDate) int
Determines the number of months between two DateTime objects.