isWithin24Hrs static method

bool isWithin24Hrs(
  1. DateTime date
)

Implementation

static bool isWithin24Hrs(DateTime date){
  Duration diff = DateTime.now().difference(date);
  final diffHours = diff.inHours < 0 ? diff.inHours*-1 : diff.inHours;
  return diffHours <= 24;
}