ModelDate class

Define the field as a date.

The base value is given as value. If not given, the current date is set.

フィールドを日付として定義します。

ベースの値をvalueとして与えます。与えられなかった場合現在の日付がセットされます。

Inheritance
Implemented types
Available Extensions
Annotations

Constructors

ModelDate([DateTime? value])
Define the field as a date.
const
factory
ModelDate.date(int year, [int? month, int? day])
Define the field as a date.
const
factory
ModelDate.fromJson(DynamicMap json)
Convert from json map to ModelDate.
factory
ModelDate.fromServer([DateTime? value])
Used to disguise the retrieval of data from the server.
const
factory
ModelDate.now()
Define the field as a date.
const
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value DateTime
Actual value.
no setteroverride

Methods

compareTo(ModelDate other) int
Compares this object to another object.
override
copyWith({int? year, int? month, int? day}) ModelDate
Create a new ModelDate with the specified year, month, and day.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() DynamicMap
Methods for Json serialization.
override
toModelTimestamp() ModelTimestamp
Convert to ModelTimestamp. All times are set to 0.
toString() String
A string representation of this object.
override

Operators

operator <(ModelDate other) bool
Compare with other ModelDate.
operator <=(ModelDate other) bool
Compare with other ModelDate.
operator ==(Object other) bool
The equality operator.
override
operator >(ModelDate other) bool
Compare with other ModelDate.
operator >=(ModelDate other) bool
Compare with other ModelDate.

Static Methods

parse(String formattedString) ModelDate
Parse from formattedString and convert to ModelTimestamp.
tryParse(String formattedString) ModelDate?
Parse from formattedString and convert to ModelTimestamp.

Constants

kSourceKey → const String
Key to store the data source.
kTimeKey → const String
Key to save time.
typeString → const String
Type key.