GenerateDartModel class
Generated class for _GenerateDartModel.
- Inheritance
- Mixed-in types
- Available extensions
Constructors
-
GenerateDartModel({String? className, Set? fields, bool? shouldInherit, String? inheritanceConstructor, String? keyStringCase, String? description, String? tableName, String? schema, List<
Map< ? indexes})String, dynamic> > -
Constructs a new instance of GenerateDartModel
from optional and required parameters.
const
-
GenerateDartModel.assertRequired({String? className, Set? fields, bool? shouldInherit, String? inheritanceConstructor, String? keyStringCase, String? description, String? tableName, String? schema, List<
Map< ? indexes})String, dynamic> > -
Constructs a new instance of GenerateDartModel,
and asserts that all required parameters are not null.
factory
- GenerateDartModel.from(BaseModel another)
-
Constructs a new instance of GenerateDartModel,
from the fields of
anotherinstance. Throws if the conversion fails.factory -
GenerateDartModel.fromJson(Map<
String, dynamic> ? json) -
Constructs a new instance of GenerateDartModel,
from
json, which must be a valid JSON object. Throws if the conversion fails.factory - GenerateDartModel.fromJsonString(String jsonString)
-
Constructs a new instance of GenerateDartModel,
from
jsonString, which must be a valid JSON String. Throws if the conversion fails.factory - GenerateDartModel.fromUri(Uri? uri)
-
Constructs a new instance of GenerateDartModel,
from the query parameters of
uri. Throws if the conversion fails.factory - GenerateDartModel.of(GenerateDartModel another)
-
Constructs a new instance of GenerateDartModel,
from the fields of
anotherinstance. Throws if the conversion fails.factory -
GenerateDartModel.optional({String? className, Set? fields, bool? shouldInherit, String? inheritanceConstructor, String? keyStringCase, String? description, String? tableName, String? schema, List<
Map< ? indexes})String, dynamic> > -
Construcs a new instance of GenerateDartModel,
forcing all parameters to be optional.
const
Properties
- $className → String
-
The runtime type of this class as a String.
no setteroverride
- className → String?
-
The class name to be used. If left null, the name is derived from the annotated class.
final
- className$ → String?
-
Returns the value of the className 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 comment describing the generated class.
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
- fields → Set?
-
A collection of fields, represented as Field instances, to be generated for the class.
final
- fields$ → Set?
-
Returns the value of the fields 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
-
indexes
→ List<
Map< ?String, dynamic> > -
Table indexes emitted by the DBML generator as an
indexes { ... }block. Each entry is a map: {'columns':'a', 'b', 'unique': true, 'name': 'idx_name', 'note': '...'}. A single-column index may pass 'columns':'a'. Consumed by the DBML emitter only; it does not affect the generated Dart model.final -
indexes$
→ List<
Map< ?String, dynamic> > -
Returns the value of the indexes field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- inheritanceConstructor → String?
-
The constructor from the superclass to use, if a custom one is required.
final
- inheritanceConstructor$ → String?
-
Returns the value of the inheritanceConstructor field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- keyStringCase → String?
-
Specifies the case format for the keys, with "CAMEL_CASE" as the default.
final
- keyStringCase$ → String?
-
Returns the value of the keyStringCase field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
-
props
→ List<
Object?> -
Field list backing
==andhashCodevia EquatableMixin. Preserves the same value semantics across hand-construction andfromJsonround-trips since every field is included.no setteroverride -
rootData
→ Map<
String, dynamic> -
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema → String?
-
Database schema this model belongs to. Acts as the DBML emission gate — models without a schema are skipped, and emitted tables are grouped into one DBML file per distinct schema value. Pass a project-wide const (e.g.
MY_APP_SCHEMA) so the schema name has a single source of truth.final - schema$ → String?
-
Returns the value of the schema field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- shouldInherit → bool?
-
Determines whether the annotated class should be inherited by the generated class.
final
- shouldInherit$ → bool?
-
Returns the value of the shouldInherit field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
- stringify → bool?
-
If set to
true, the toString method will be overridden to output this instance's props.no setterinherited - tableName → String?
-
Database table name this model maps to. Consumed by the DBML generator (and any tool that emits a wire-level table name). When null, the table name is derived from the class name (Model prefix stripped, snake-cased) — no automatic pluralisation.
final
- tableName$ → String?
-
Returns the value of the tableName field.
If the field is nullable, the return value may be null; otherwise, it
will always return a non-null value.
no setter
Methods
-
copyWith(
{String? className, Set? fields, bool? shouldInherit, String? inheritanceConstructor, String? keyStringCase, String? description, String? tableName, String? schema, List< Map< ? indexes}) → GenerateDartModelString, dynamic> > -
Available on GenerateDartModel, provided by the GenerateDartModelX extension
Creates a copy of this instance, replacing the specified fields. -
copyWithout(
{bool className = true, bool fields = true, bool shouldInherit = true, bool inheritanceConstructor = true, bool keyStringCase = true, bool description = true, bool tableName = true, bool schema = true, bool indexes = true}) → GenerateDartModel -
Available on GenerateDartModel, provided by the GenerateDartModelX 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}) → GenerateDartModel -
Available on GenerateDartModel, provided by the GenerateDartModelX 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 -
Preserves BaseModel's JSON pretty-print toString rather than letting
EquatableMixin's default toString shadow it. The mixin sits after
the BaseModel chain in the linearization, so we re-override here.
override
-
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) → GenerateDartModel? -
Constructs a new instance of GenerateDartModel,
from
json, which must be a valid JSON object. Returnsnullifjsonisnullor if the conversion fails. -
fromJsonStringOrNull(
String? jsonString) → GenerateDartModel? -
Constructs a new instance of GenerateDartModel,
from
jsonString, which must be a valid JSON String. ReturnsnullifjsonStringisnullor if the conversion fails.override -
fromOrNull(
BaseModel? another) → GenerateDartModel? -
Constructs a new instance of GenerateDartModel,
from the fields of
anotherinstance. Returnsnullifanotherisnullor if the conversion fails. -
fromUriOrNull(
Uri? uri) → GenerateDartModel? -
Constructs a new instance of GenerateDartModel,
from the query parameters of
uri. Returnsnullifuriisnullor if the conversion fails. -
ofOrNull(
GenerateDartModel? other) → GenerateDartModel? -
Constructs a new instance of GenerateDartModel,
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.