getDateByPeriod static method

String getDateByPeriod({
  1. required String date,
  2. int days = 0,
  3. String format = Format.fyyyyMMdd,
})

date by period like add days or substract days

Implementation

static String getDateByPeriod(
    {required String date, int days = 0, String format = Format.fyyyyMMdd}) {
  return dateTimeToString(
      date: stringToDateTime(date: date, format: format)
          .add(Duration(days: days)),
      format: format);
}