getFirstDayOfMonth static method

DateTime getFirstDayOfMonth({
  1. DateTime? month,
})

Returns a date with the same month and year of the specified date, and the first day of that month.

If month is not specified, return the first day of the current month.

Implementation

static DateTime getFirstDayOfMonth({DateTime? month}) => (month != null)
    ? DateTime(month.year, month.month)
    : getFirstDayOfMonth(month: DateTime.now());