onSubmit property

dynamic Function(Object?)? onSubmit
final

Called whenever the confirm button tapped on date range picker. The dates or ranges that have been selected are confirmed and the selected value is available in the value argument.

See also:


Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('Date Range Picker'),
        ),
        body: Container(
            child: SfHijriDateRangePicker(
          showActionButtons: true,
          onSubmit: (Object value) {
            if (value is HijriDateRange) {
              final HijriDateTime rangeStartDate = value.startDate!;
              final HijriDateTime rangeEndDate = value.endDate!;
            } else if (value is HijriDateTime) {
              final HijriDateTime selectedDate = value;
            } else if (value is List<HijriDateTime>) {
              final List<HijriDateTime> selectedDates = value;
            } else if (value is List<HijriDateRange>) {​
              final List<HijriDateRange> selectedRanges = value;
            }
          },
        )));
  }

Implementation

final Function(Object?)? onSubmit;