ThisModel<T extends Model> class
abstract
A class that extends Model and provides a reference to itself.
Constructors
Properties
- $class ↔ String
-
The class name of the model as a string.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
The unique identifier of the model.
getter/setter pairinherited
- model → T
-
latefinal
- ref ↔ DataRefModel?
-
The unique reference to the model.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copy<
T extends Model> () → T -
Returns a new copy of the Model with the exact same fields.
inherited
-
copyWith<
T extends Model> (Model? other) → T -
Returns a new copy of the Model with the fields updated from the
other
Model.inherited -
copyWithJson<
T extends Model> (Map< String, dynamic> ? otherData) → T -
Returns a new copy of the Model with the fields updated from
otherData
.inherited -
empty<
T extends Model> () → T -
Returns a new instance of the Model with all fields set to
null
.inherited -
equals(
dynamic other) → bool -
Compares the Model with another Model using the
DeepCollectionEquality
and returnstrue
if they are equal.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sortedJson(
{dynamic defaultValue, bool includeNulls = false}) → Map< String, dynamic> -
Returns a Json i.e.
Map<String, dynamic>
representation of the Model, with the keys sorted alphabetically.inherited -
toJson(
{dynamic defaultValue, bool includeNulls = false}) → Map< String, dynamic> -
Returns a Json i.e.
Map<String, dynamic>
representation of the Model.inherited -
toJsonString(
) → String -
Returns a JSON string representation of the Model.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toUrl(
) → Uri -
Converts the current Model to a Uri that can be used as a distinct
identifier. The model must not be too large to avoid exceeding the
maximum length of a URL.
inherited
-
updateWith(
Model? other) → void -
Updates the fields of the Model with the fields from the
other
Model.inherited -
updateWithJson(
Map< String, dynamic> ? otherData) → void -
Updates the fields of the Model with the fields from
otherData
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited