showDialogPicker method

void showDialogPicker(
  1. BuildContext context
)

Implementation

void showDialogPicker(BuildContext context){
  selectedDate = showDatePicker(
    context: context,
    initialDate: DateTime.now(),
    firstDate: DateTime(2000),
    lastDate: DateTime(2050),
    builder: (BuildContext context, Widget? child) {
      return Theme(
        data: ThemeData.dark(),
        child: child!,
      );
    },
  );
  selectedDate.then((value) {
    setState(() {
      if(value == null) return;
      date = Tools.getFormattedDateSimple(value.millisecondsSinceEpoch);
    });
  }, onError: (error) {
    print(error);
  });
}