copyWith method

Connection copyWith({
  1. String? id,
  2. String? connectionString,
  3. DateTime? createdAt,
  4. bool? isActive,
})

Creates a copy of this connection with the given fields replaced.

Returns a new Connection instance with the same values as this one, except for the fields explicitly provided.

Implementation

Connection copyWith({
  String? id,
  String? connectionString,
  DateTime? createdAt,
  bool? isActive,
}) {
  return Connection(
    id: id ?? this.id,
    connectionString: connectionString ?? this.connectionString,
    createdAt: createdAt ?? this.createdAt,
    isActive: isActive ?? this.isActive,
  );
}