updateRange method

void updateRange({
  1. DateTime? from,
  2. DateTime? to,
})

Implementation

void updateRange({DateTime? from, DateTime? to}) {
  assert(from != null || to != null, 'from and to cannot be both null');
  assert(_state != null, 'controller is not attached to any calendar');

  // update the date time range of the calendar,
  // if not provided, keep the old value
  final range = DateTimeRange(
    start: from ?? _state!.range.start,
    end: to ?? _state!.range.end,
  );

  _state!.updateRange(range);
}