view property Null safety

DateRangePickerView? view

The current visible DateRangePickerView of SfDateRangePicker.

Implementation

DateRangePickerView? get view => _view;
void view=(DateRangePickerView? value)

Set the SfDateRangePickerView for the SfDateRangePicker.

The SfDateRangePicker will display the view sets to this property.

See also:


class MyAppState extends State<MyApp> {
DateRangePickerController _pickerController = DateRangePickerController();

 @override
 void initState() {
   _pickerController.view = DateRangePickerView.year;
   super.initState();
 }

 @override
 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfDateRangePicker(
         controller: _pickerController,
         view: DateRangePickerView.month,
         selectionMode: DateRangePickerSelectionMode.single,
      ),
     ),
   );
 }
}

Implementation

set view(DateRangePickerView? value) {
  if (_view == value) {
    return;
  }

  _view = value;
  notifyPropertyChangedListeners('view');
}