isBeforeCurrentDate static method

bool isBeforeCurrentDate(
  1. String strDate, {
  2. int? minutesAdd,
})

Implementation

static bool isBeforeCurrentDate(String strDate, {int? minutesAdd}) {
  if (strDate.isNotEmpty) {
    var date = DateTime.parse(strDate).toLocal();
    if (minutesAdd != null) {
      date = date.add(Duration(minutes: minutesAdd));
    }
    var now = DateTime.now();
    return date.isBefore(now);
  }
  return false;
}