isWithin24Hours method

bool isWithin24Hours (
  1. {DateTime dateTime,
  2. int millisecondsSinceEpoch}
)

Implementation

static bool isWithin24Hours({DateTime dateTime, int millisecondsSinceEpoch}) {
  if(dateTime == null && millisecondsSinceEpoch == null) return false;
  if(dateTime != null) return isWithin24Hours(millisecondsSinceEpoch: dateTime.millisecondsSinceEpoch);
  return (DateTime.now().millisecondsSinceEpoch - millisecondsSinceEpoch) <= Duration(hours: 24).inMilliseconds;
}