copyWith method

FieldModel copyWith({
  1. Object? fieldPath,
  2. dynamic fieldType,
  3. bool? nullable,
  4. List<Map<String, dynamic>>? children,
  5. bool? primaryKey,
  6. bool? foreignKey,
  7. String? description,
  8. Object? references,
  9. String? columnDefault,
})

Creates a copy of this instance, replacing the specified fields.

Implementation

FieldModel copyWith({
  Object? fieldPath,
  dynamic? fieldType,
  bool? nullable,
  List<Map<String, dynamic>>? children,
  bool? primaryKey,
  bool? foreignKey,
  String? description,
  Object? references,
  String? columnDefault,
}) {
  return FieldModel.assertRequired(
    fieldPath: fieldPath ?? this.fieldPath,
    fieldType: fieldType ?? this.fieldType,
    nullable: nullable ?? this.nullable,
    children: children ?? this.children,
    primaryKey: primaryKey ?? this.primaryKey,
    foreignKey: foreignKey ?? this.foreignKey,
    description: description ?? this.description,
    references: references ?? this.references,
    columnDefault: columnDefault ?? this.columnDefault,
  );
}