copyWith method

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

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

Implementation

FieldModel copyWith({
  List<String>? fieldPath,
  dynamic? fieldType,
  bool? nullable,
  List<Map<String, dynamic>>? children,
  bool? primaryKey,
  bool? foreignKey,
  Object? fallback,
  String? description,
}) {
  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,
    fallback: fallback ?? this.fallback,
    description: description ?? this.description,
  );
}