rangeTextStyle property
The text style for the text in the selected range or ranges cell of SfDateRangePicker month view.
The style applies to the dates that falls between the PickerDateRange.startDate and PickerDateRange.endDate.
Defaults to null.
Using a SfDateRangePickerTheme
gives more fine-grained control over the
appearance of various components of the date range picker.
Note: This applies only when DateRangePickerSelectionMode set as DateRangePickerSelectionMode.range or DateRangePickerSelectionMode.multiRange.
See also:
- PickerDateRange, which used to holds the start and end date of the selected range.
- selectionMode, which allows to customize the selection modes with the available modes.
- selectionShape, which allows to customize the shape of the selection view in date range picker.
- selectionColor, which fills the background of the selected cells in the date range picker.
- startRangeSelectionColor, which fills the background of the first cell of the range selection in date range picker.
- endRangeSelectionColor, which fills the background of the last cell of the range selection in date range picker.
- rangeSelectionColor, which fills the background of the in between cells of date range picker in range selection.
- selectionRadius, which is the radius for the selection view in the date range picker when the selection shape set as DateRangePickerSelectionShape.circle.
- selectionTextStyle, which is used to set the text style for the text in the selected cell of date range picker.
- Knowledge base: Range selection using multiple view picker
- Knowledge base: How to change the selection radius
- Knowledge base: How to customize the selected range cells
- Knowledge base: How to change the selection shape
- Knowledge base: How to customize the selected month cell
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
controller: _pickerController,
view: DateRangePickerView.month,
enablePastDates: false,
selectionMode: DateRangePickerSelectionMode.multiRange,
rangeTextStyle: TextStyle(
fontStyle: FontStyle.italic,
fontWeight: FontWeight.w500,
fontSize: 12,
color: Colors.black),
),
),
);
}
Implementation
final TextStyle? rangeTextStyle;