getDateByDayOffset static method

DateTime getDateByDayOffset({
  1. int offset = 0,
})

获取指定天数的日期,0=当天,1=明天,-1=昨天

Implementation

static DateTime getDateByDayOffset({int offset = 0}) =>
    DateTime.fromMillisecondsSinceEpoch(
      DateTime.now().millisecondsSinceEpoch + offset * oneDay,
    );