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
- 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
- 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
- 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 -
rootData
→ Map<
String, dynamic> -
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
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 returnstrue
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. Returnsnull
ifjson
isnull
or if the conversion fails. -
fromJsonStringOrNull(
String? jsonString) → DataRefModel? -
Constructs a new instance of DataRefModel,
from
jsonString
, which must be a valid JSON String. Returnsnull
ifjsonString
isnull
or if the conversion fails.override -
fromOrNull(
BaseModel? another) → DataRefModel? -
Constructs a new instance of DataRefModel,
from the fields of
another
instance. Returnsnull
ifanother
isnull
or if the conversion fails. -
fromUriOrNull(
Uri? uri) → DataRefModel? -
Constructs a new instance of DataRefModel,
from the query parameters of
uri
. Returnsnull
ifuri
isnull
or if the conversion fails. -
ofOrNull(
DataRefModel? other) → DataRefModel? -
Constructs a new instance of DataRefModel,
from the fields of
another
instance. Returnsnull
ifanother
isnull
or if the conversion fails.
Constants
- CLASS_NAME → const String
- The runtime type of this class as a String.