nextMonth function

DateTime nextMonth([
  1. DateTime? date
])

下一个月

Implementation

DateTime nextMonth([DateTime? date]) {
  final now = date ?? DateTime.now();
  final month = now.month + 1;
  final year = now.year;
  return DateTime(month > 12 ? year + 1 : year, month > 12 ? 1 : month);
}