DataRefModel class

Generated class for _DataRefModel.

Inheritance
Available extensions

Constructors

DataRefModel({String? id, required List<String>? collection})
Constructs a new instance of DataRefModel from optional and required parameters.
const
DataRefModel.assertRequired({String? id, List<String>? collection})
Constructs a new instance of DataRefModel, and asserts that all required parameters are not null.
factory
DataRefModel.from(BaseModel another)
Constructs a new instance of DataRefModel, from the fields of another instance. Throws if the conversion fails.
factory
DataRefModel.fromJson(Map<String, dynamic>? json)
Constructs a new instance of DataRefModel, from json, which must be a valid JSON object. Throws if the conversion fails.
factory
DataRefModel.fromJsonString(String jsonString)
Constructs a new instance of DataRefModel, from jsonString, which must be a valid JSON String. Throws if the conversion fails.
factory
DataRefModel.fromUri(Uri? uri)
Constructs a new instance of DataRefModel, from the query parameters of uri. Throws if the conversion fails.
factory
DataRefModel.of(DataRefModel another)
Constructs a new instance of DataRefModel, from the fields of another instance. Throws if the conversion fails.
factory
DataRefModel.optional({String? id, List<String>? collection})
Construcs a new instance of DataRefModel, forcing all parameters to be optional.
const

Properties

$className → String
The runtime type of this class as a String.
no setteroverride
collection → List<String>?
A list representing the hierarchical path where the document or collection resides.
final
collection$ → List<String>
Returns the value of the collection field. If the field is nullable, the return value may be null; otherwise, it will always return a non-null value.
no setter
collectionId → String

Available on DataRefModel, provided by the DataRefModelExtension extension

Returns the collection ID, which is the last segment in the collection path.
no setter
collectionPath → String?

Available on DataRefModel, provided by the DataRefModelExtension extension

The full collection path of the reference, always ending in "/".
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasValidCollection → bool

Available on DataRefModel, provided by the DataRefModelExtension extension

Returns true collection is not null, does not contain only empty strings, and is not empty.
no setter
hasValidId → bool

Available on DataRefModel, provided by the DataRefModelExtension extension

Returns true id is not null and is not empty.
no setter
id → String?
The document ID within the database. If null, the reference points to a collection instead of a specific document.
final
id$ → String?
Returns the value of the id field. If the field is nullable, the return value may be null; otherwise, it will always return a non-null value.
no setter
isDocumentRef → bool

Available on DataRefModel, provided by the DataRefModelExtension extension

no setter
isOnlyCollectionRef → bool

Available on DataRefModel, provided by the DataRefModelExtension extension

no setter
model → DataRefModel
no setterinherited
parentPath → String

Available on DataRefModel, provided by the DataRefModelExtension extension

Returns the parent path of the collection path. This is the collection path without the last segment.
no setter
parentSegments → List<String>

Available on DataRefModel, provided by the DataRefModelExtension extension

Returns the parent segments of the collection path. This is the collection path without the last segment.
no setter
path → String

Available on DataRefModel, provided by the DataRefModelExtension extension

The full path of the reference. If it ends with "/", it's a path to a collection, otherwise it's a path to a document.
no setter
pathSegments → List<String>

Available on DataRefModel, provided by the DataRefModelExtension extension

The full path segments of the reference, in order, including the document ID if it's not null.
no setter
props → List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stringify → bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
tableName → String?

Available on DataRefModel, provided by the DataRefModelExtension extension

The table name, i.e. the last element in collection.
no setter

Methods

copyWith({String? id, List<String>? collection}) → DataRefModel

Available on DataRefModel, provided by the DataRefModelX extension

Creates a copy of this instance, replacing the specified fields.
copyWithout({bool id = true, bool collection = true}) → DataRefModel

Available on DataRefModel, provided by the DataRefModelX extension

Creates a copy of this instance, removing the specified fields.
equals(dynamic other) → bool
Compares the BaseModel with another BaseModel using the DeepCollectionEquality and returns true if they are equal.
inherited
mergeWith(BaseModel? other, {bool deepMerge = false}) → DataRefModel

Available on DataRefModel, provided by the DataRefModelX extension

Creates a copy of this instance, merging another model's fields into this model's fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sortedJson({bool includeNulls = false}) → Map<String, dynamic>
Returns a Json i.e. Map<String, dynamic> representation of the BaseModel, with the keys sorted alphabetically.
inherited
toJson({bool includeNulls = false}) → Map<String, dynamic>
Returns a Json i.e. Map<String, dynamic> representation of the BaseModel.
override
toJsonString() → String
Returns a JSON string representation of the BaseModel.
inherited
toString() → String
A string representation of this object.
inherited
toUrl() → Uri
Converts the current BaseModel 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

Operators

operator +(DataRefModel other) → DataRefModel

Available on DataRefModel, provided by the DataRefModelExtension extension

Adds two DataRefModel objects. Collection paths must have an odd number of segments.
operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJsonOrNull(Map<String, dynamic>? json) → DataRefModel?
Constructs a new instance of DataRefModel, from json, which must be a valid JSON object. Returns null if json is null or if the conversion fails.
fromJsonStringOrNull(String? jsonString) → DataRefModel?
Constructs a new instance of DataRefModel, from jsonString, which must be a valid JSON String. Returns null if jsonString is null or if the conversion fails.
fromOrNull(BaseModel? another) → DataRefModel?
Constructs a new instance of DataRefModel, from the fields of another instance. Returns null if another is null or if the conversion fails.
fromUriOrNull(Uri? uri) → DataRefModel?
Constructs a new instance of DataRefModel, from the query parameters of uri. Returns null if uri is null or if the conversion fails.
ofOrNull(DataRefModel? other) → DataRefModel?
Constructs a new instance of DataRefModel, from the fields of another instance. Returns null if another is null or if the conversion fails.

Constants

CLASS_NAME → const String
The runtime type of this class as a String.