copyWithJson<T extends Model> method

T copyWithJson<T extends Model>(
  1. Map<String, dynamic>? otherData
)

Returns a new copy of the Model with the fields updated from otherData.

Implementation

T copyWithJson<T extends Model>(
  Map<String, dynamic>? otherData,
) {
  if (otherData != null && otherData.isNotEmpty) {
    return this.copy<T>()..updateWithJson(otherData);
  }
  return this.copy<T>();
}