Date.addMonth constructor

Date.addMonth(
  1. Date current
)

Implementation

factory Date.addMonth(Date current) {
  if (current.month! + 1 == 13) {
    final year = current.year! + 1;
    final month = 1;
    return Date(month: month, year: year);
  } else {
    final month = current.month! + 1;
    return Date(month: month, year: current.year);
  }
}