FieldModel class
Generated class for _FieldModel.
- Inheritance
- Available extensions
Constructors
-
FieldModel({Object? fieldPath, dynamic fieldType, bool? nullable, List<
Map< ? children, bool? primaryKey, bool? foreignKey, String? description, Object? references, String? columnDefault})String, dynamic> > -
Constructs a new instance of FieldModel
from optional and required parameters.
const
-
FieldModel.assertRequired({Object? fieldPath, dynamic fieldType, bool? nullable, List<
Map< ? children, bool? primaryKey, bool? foreignKey, String? description, Object? references, String? columnDefault})String, dynamic> > -
Constructs a new instance of FieldModel,
and asserts that all required parameters are not null.
factory
- FieldModel.from(BaseModel another)
-
Constructs a new instance of FieldModel,
from the fields of
anotherinstance. Throws if the conversion fails.factory -
FieldModel.fromJson(Map<
String, dynamic> ? json) -
Constructs a new instance of FieldModel,
from
json, which must be a valid JSON object. Throws if the conversion fails.factory - FieldModel.fromJsonString(String jsonString)
-
Constructs a new instance of FieldModel,
from
jsonString, which must be a valid JSON String. Throws if the conversion fails.factory - FieldModel.fromUri(Uri? uri)
-
Constructs a new instance of FieldModel,
from the query parameters of
uri. Throws if the conversion fails.factory - FieldModel.of(FieldModel another)
-
Constructs a new instance of FieldModel,
from the fields of
anotherinstance. Throws if the conversion fails.factory -
FieldModel.optional({Object? fieldPath, dynamic fieldType, bool? nullable, List<
Map< ? children, bool? primaryKey, bool? foreignKey, String? description, Object? references, String? columnDefault})String, dynamic> > -
Construcs a new instance of FieldModel,
forcing all parameters to be optional.
const
Properties
- $className → String
-
The runtime type of this class as a String.
no setteroverride
-
children
→ List<
Map< ?String, dynamic> > -
Children of this field, allowing for nested fields or complex structures.
final
-
children$
→ List<
Map< ?String, dynamic> > -
Returns the value of the children field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- columnDefault → String?
-
The SQL DEFAULT expression for this column, emitted verbatim by the DBML generator as
default: <value>. Write the exact DBML token: a quoted string ("'PENDING'"), a backtick expression ("now()"), or a bare literal ("false", "0"). Consumed by the DBML emitter only; it does not affect the generated Dart model.final - columnDefault$ → String?
-
Returns the value of the columnDefault field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- description → String?
-
A brief comment or explanation for the field's purpose.
final
- description$ → String?
-
Returns the value of the description field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- fieldPath → Object?
-
The path of the field within the model. Accepts a String ('profile.id'), a String Iterable (
'profile', 'id'), or null. Dot-separated and list forms are normalised to the same list of segments — multi-segment paths produce nested map accessors (json?'profile'?'id') in the generated fromJson.final - fieldPath$ → Object?
-
Returns the value of the fieldPath field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- fieldType → dynamic
-
The data type of the field, such as "String", "int", or any dynamic type.
final
- fieldType$ → dynamic
-
Returns the value of the fieldType field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- fieldTypeCode → String?
-
The type code of the field (the type with any special characters, such
as 'String?').
no setterinherited
- foreignKey → bool?
-
Whether this field serves as a foreign key.
final
- foreignKey$ → bool?
-
Returns the value of the foreignKey field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- nullable → bool?
-
Whether the field can hold a null value.
final
- nullable$ → bool?
-
Returns the value of the nullable field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- primaryKey → bool?
-
Whether this field serves as a primary key.
final
- primaryKey$ → bool?
-
Returns the value of the primaryKey field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- references → Object?
-
The target model class this field references. Implies foreignKey. Resolves to the target model's primary key column.
final
- references$ → Object?
-
Returns the value of the references field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toRecord → TFieldRecord
-
Converts this to a TFieldRecord.
no setterinherited
Methods
-
copyWith(
{Object? fieldPath, dynamic fieldType, bool? nullable, List< Map< ? children, bool? primaryKey, bool? foreignKey, String? description, Object? references, String? columnDefault}) → FieldModelString, dynamic> > -
Available on FieldModel, provided by the FieldModelX extension
Creates a copy of this instance, replacing the specified fields. -
copyWithout(
{bool fieldPath = true, bool fieldType = true, bool nullable = true, bool children = true, bool primaryKey = true, bool foreignKey = true, bool description = true, bool references = true, bool columnDefault = true}) → FieldModel -
Available on FieldModel, provided by the FieldModelX extension
Creates a copy of this instance, removing the specified fields. -
equals(
dynamic other) → bool -
Compares the BaseModel with another BaseModel using the
DeepCollectionEqualityand returnstrueif they are equal.inherited -
mergeWith(
BaseModel? other, {bool deepMerge = false}) → FieldModel -
Available on FieldModel, provided by the FieldModelX 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 ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJsonOrNull(
Map< String, dynamic> ? json) → FieldModel? -
Constructs a new instance of FieldModel,
from
json, which must be a valid JSON object. Returnsnullifjsonisnullor if the conversion fails. -
fromJsonStringOrNull(
String? jsonString) → FieldModel? -
Constructs a new instance of FieldModel,
from
jsonString, which must be a valid JSON String. ReturnsnullifjsonStringisnullor if the conversion fails. -
fromOrNull(
BaseModel? another) → FieldModel? -
Constructs a new instance of FieldModel,
from the fields of
anotherinstance. Returnsnullifanotherisnullor if the conversion fails. -
fromUriOrNull(
Uri? uri) → FieldModel? -
Constructs a new instance of FieldModel,
from the query parameters of
uri. Returnsnullifuriisnullor if the conversion fails. -
ofOrNull(
FieldModel? other) → FieldModel? -
Constructs a new instance of FieldModel,
from the fields of
anotherinstance. Returnsnullifanotherisnullor if the conversion fails.
Constants
- $tableName → const String
-
The database table name this model maps to, mirroring
tableName:on the annotation. When the annotation omitstableName:, this is derived from the class name (Model prefix/suffix stripped, snake-cased) — no automatic pluralisation. The$prefix matches the convention used by the other framework-reserved statics ($className,$primaryKey,$foreignKeys,$values) and prevents collisions with user columns namedtable_name/tableName. - CLASS_NAME → const String
- The runtime type of this class as a String.