show static method

Future<DateTime?> show(
  1. {required BuildContext context,
  2. DateTime? initialDate,
  3. DateTime? firstDate,
  4. DateTime? lastDate}
)

Implementation

static Future<DateTime?> show({
  required BuildContext context,
  DateTime? initialDate,
  DateTime? firstDate,
  DateTime? lastDate,
}) async {
  final now = DateTime.now();

  return await showDialog<DateTime>(
    context: context,
    builder: (context) {
      return RehaculDatePicker(
        initialDate: initialDate ?? now,
        firstDate: firstDate ??
            DateTime(
              now.year - 1,
              now.month,
              now.day,
            ),
        lastDate: lastDate ??
            DateTime(
              now.year,
              now.month,
              now.day,
            ),
      );
    },
  );
}