showBasic static method

Future<DateTime?> showBasic(
  1. BuildContext context,
  2. ThemeData theme
)

Implementation

static Future<DateTime?> showBasic(
    BuildContext context, ThemeData theme) async {
  DateTime? dtFinal;
  await showDatePicker(
    context: context,
    locale: Locale("es", "PY"),
    firstDate: DateTime.now(),
    initialDate: DateTime.now(),
    lastDate: DateTime.now().add(Duration(days: 365)),
    builder: (BuildContext context, Widget? child) {
      return Theme(
        data: theme.copyWith(
          colorScheme: ColorScheme.light(
            primary: theme.primaryColor,
            onPrimary: Colors.white,
            surface: theme.primaryColor,
            onSurface: theme.primaryColor,
            secondary: theme.primaryColor,
          ),
          buttonTheme: ButtonThemeData(textTheme: ButtonTextTheme.accent),
        ),
        child: child ?? Center(),
      );
    },
  );
  return dtFinal;
}