showPopup method

void showPopup(
  1. BuildContext context,
  2. int hours,
  3. int minutes,
  4. dynamic onClose(
    1. DateTime endDate
    ),
)

Implementation

void showPopup(BuildContext context, int hours, int minutes, Function(DateTime endDate) onClose) {
  DateTime today = DateTime.now();
  DateTime selectedDate = DateTime(today.year, today.month, today.day, hours, minutes);
  showDialog(
    context: context,
    builder: (BuildContext context) => NsgPopUp(
      height: (!kIsWeb && (Platform.isIOS || Platform.isAndroid)) ? 420 : 120,
      title: tran.enter_time,
      onConfirm: () {
        onClose(selectedDate);
      },
      onCancel: () {
        Navigator.pop(context);
      },
      getContent: () => [
        TimePickerContent(
          dateForTime: dateForTime,
          initialTime: Jiffy.parseFromDateTime(DateTime(0)).addDuration(initialTime).dateTime,
          onChange: ((endDate) {
            selectedDate = endDate;
          }),
          //  onClose,
        ),
      ],
    ),
  );
}