Date.removeMonth constructor

Date.removeMonth(
  1. Date current
)

Implementation

factory Date.removeMonth(Date current) {
  if (current.month! - 1 == 0) {
    final year = current.year! - 1;
    final month = 12;
    return Date(month: month, year: year);
  } else {
    final month = current.month! - 1;
    return Date(month: month, year: current.year);
  }
}