Articles in this section
Category / Section

How to deselect the selected date in the Flutter Date Range Picker (SfDateRangePicker)

1 min read

In the Flutter date range picker, you can deselect a previously selected date by using the toggleDaySelection in the date range picker.

Set the toggleDaySelection value to true to enable the ability to deselect a selected date.

import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
 
void main() => runApp(DeSelection());
 
class DeSelection extends StatelessWidget {
 
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          body: Card(
            margin: const EdgeInsets.fromLTRB(50, 150, 50, 150),
            child: SfDateRangePicker(
              view: DateRangePickerView.month,
              toggleDaySelection: true,
            ),
          )
      ),
    );
  }
}

View the Github Sample here.

deselection gif

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied