Weekday class
Represents a day of the week (Monday to Sunday) with associated properties.
This class provides static instances for each day and helper methods. It uses the standard Dart DateTime weekday numbering (Monday = 1, ..., Sunday = 7).
- Implemented types
Constructors
- Weekday.fromDateTime(DateTime dateTime)
-
Creates a Weekday instance from a standard Dart DateTime weekday integer.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isWeekday → bool
-
final
- isWeekend → bool
-
final
- name → String
-
final
- next → Weekday
-
Returns the next day of the week. Wraps around from Sunday to Monday.
no setter
- previous → Weekday
-
Returns the previous day of the week. Wraps around from Monday to Sunday.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shortestName → String
-
final
- shortName → String
-
final
- value → int
-
The integer value of the weekday (1 for Monday, 7 for Sunday).
final
Methods
-
compareTo(
Weekday other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- friday → const Weekday
- Represents Friday (value: 5).
- monday → const Weekday
- Represents Monday (value: 1).
- saturday → const Weekday
- Represents Saturday (value: 6).
- sunday → const Weekday
- Represents Sunday (value: 7).
- thursday → const Weekday
- Represents Thursday (value: 4).
- tuesday → const Weekday
- Represents Tuesday (value: 2).
-
values
→ const List<
Weekday> - A list of all Weekday instances in order (Monday to Sunday).
- wednesday → const Weekday
- Represents Wednesday (value: 3).