前一个月
DateTime prevMonth([DateTime? date]) { final now = date ?? DateTime.now(); final month = now.month - 1; final year = now.year; return DateTime(month < 1 ? year - 1 : year, month < 1 ? 12 : month); }