dayDifference property

int dayDifference

If value is NULL returns Null Else returns the difference between current date and the object in days excluding the the time values

Implementation

int get dayDifference {
  DateTime now = DateTime.now();
  return DateTime(year, month, day)
      .difference(DateTime(now.year, now.month, now.day))
      .inDays;
}