show static method

Future<DateTime?> show(
  1. BuildContext context, {
  2. DateTime? initialDate,
  3. DateTime? firstDate,
  4. DateTime? lastDate,
  5. String cancelText = 'Cancel',
  6. String applyText = 'Apply',
  7. String previousMonthTooltip = 'Previous month',
  8. String nextMonthTooltip = 'Next month',
  9. String barrierLabel = 'Dismiss',
})

Implementation

static Future<DateTime?> show(
  BuildContext context, {
  DateTime? initialDate,
  DateTime? firstDate,
  DateTime? lastDate,
  String cancelText = 'Cancel',
  String applyText = 'Apply',
  String previousMonthTooltip = 'Previous month',
  String nextMonthTooltip = 'Next month',
  String barrierLabel = 'Dismiss',
}) async {
  final fluffyTheme = context.fluffyTheme;
  final pickedDate = await showGeneralDialog(
    context: context,
    barrierDismissible: true,
    barrierLabel: barrierLabel,
    barrierColor: FluffyColors.barrier,
    transitionDuration: FluffyDurations.dialogTransition,
    transitionBuilder: (context, anim1, anim2, child) {
      return FadeTransition(
        opacity: anim1,
        child: ScaleTransition(
          scale: Tween<double>(begin: 0.95, end: 1.0).animate(
            CurvedAnimation(parent: anim1, curve: Curves.easeOutCubic),
          ),
          child: child,
        ),
      );
    },
    pageBuilder: (context, anim1, anim2) {
      return FluffyTheme(
        data: fluffyTheme,
        child: _DatePickerDialog(
          initialDate: initialDate,
          firstDate: firstDate,
          lastDate: lastDate,
          cancelText: cancelText,
          applyText: applyText,
          previousMonthTooltip: previousMonthTooltip,
          nextMonthTooltip: nextMonthTooltip,
        ),
      );
    },
  );
  return pickedDate is DateTime ? pickedDate : null;
}