RandomDTOptions class

Constructors

RandomDTOptions({bool allowPastDates = false, int futureYearLimit = 5, int? startYear, int? endYear, List<int>? months, List<int>? days, List<int>? hours, List<int>? minutes, List<int>? seconds, List<int>? milliseconds, List<int>? microseconds})
Initialize RandomDTOptions
RandomDTOptions.withRange({bool allowPastDates = false, int futureYearLimit = 5, TimeRange yearRange = const TimeRange(), TimeRange monthRange = const TimeRange(start: 1, end: 12), TimeRange dayRange = const TimeRange(start: 1, end: 31), TimeRange hourRange = const TimeRange(start: 0, end: 23), TimeRange minuteRange = const TimeRange(start: 0, end: 59), TimeRange secondRange = const TimeRange(start: 0, end: 59), TimeRange millisecondRange = const TimeRange(start: 0, end: 999), TimeRange microsecondRange = const TimeRange(start: 0, end: 999)})

Properties

allowPastDates bool
Whether to allow resulting DateTime object to be from the past.
final
futureYearLimit int
final
hashCode int
Returns the hash code
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getValidDays(int year, int month) List<int>
Get valid days based on the passed month.
getValidHours(int day) List<int>
Handling precision to this level seems unnecessary
getValidMicroseconds(int millisecond) List<int>
Returns list of possible microseconds
getValidMilliseconds(int second) List<int>
Returns list of possible milliseconds
getValidMinutes(int hour) List<int>
Returns list of possible minutes
getValidMonths(int year) List<int>
Get valid months based on the passed year.
getValidSeconds(int minute) List<int>
Returns list of possible seconds
getValidYears() List<int>
Get valid years from _years, which is the list of possible years filtered using the other parameters passed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Converts the class's attributes to string It although does not include units after hours as their list values can be large, ex: milliseconds' list if of 0 to 999. And also because it is thought to not cause errors.
override

Operators

operator ==(Object other) bool
Checks if two RandomDTOptions objects are equal compares list through the elements in them rather than the list itself
override