DateTimeCast class
Cast attribute to/from DateTime
Handles string to DateTime conversion automatically
Example:
Map<String, Type> get casts => {
'birth_date': DateTimeCast,
'published_at': DateTimeCast,
};
- Inheritance
-
- Object
- AttributeCaster<
DateTime> - DateTimeCast
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
dynamic value) → DateTime? -
Convert database value to model property value
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
DateTime? value) → dynamic -
Convert model property value to database value
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited