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