Skip to content

Commit

Permalink
fix: Added CopyWith.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed May 15, 2024
1 parent 4e94898 commit afd1cc9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/katana_model/lib/src/model_field_value.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,17 @@ class ModelDate extends ModelFieldValue<DateTime>
other.value.millisecondsSinceEpoch,
);
}

/// Create a new [ModelDate] with the specified [year], [month], and [day].
///
/// 指定した[year][month][day]で新しい[ModelDate]を作成します。
ModelDate copyWith({int? year, int? month, int? day}) {
return ModelDate.date(
year ?? value.year,
month ?? value.month,
day ?? value.day,
);
}
}

@immutable
Expand Down

0 comments on commit afd1cc9

Please sign in to comment.