mostRecentMonth function

DateTime mostRecentMonth(
  1. {DateTime? date,
  2. int addMonths = 0}
)

Implementation

DateTime mostRecentMonth({DateTime? date, int addMonths = 0}) {
  date ??= DateTime.now();

  return DateTime(date.year, date.month + addMonths);
}