copyWith method

Model copyWith({
  1. String? id,
  2. String? userId,
  3. Map<String, dynamic>? data,
})

Copies an instance with the possibility of overriding certain fields.

Implementation

Model copyWith({String? id, String? userId, Map<String, dynamic>? data}) =>
    Model(
      id: id ?? this.id,
      userId: userId ?? this.userId,
      data: data ?? this.data,
    );