pastDate method

DateTime pastDate({
  1. int yearsBack = 5,
})

Generate a past date.

Implementation

DateTime pastDate({int yearsBack = 5}) {
  final now = DateTime.now();
  return date(
    start: now.subtract(Duration(days: yearsBack * 365)),
    end: now,
  );
}