focus method

void focus(
  1. DateTime day, {
  2. int months = 1,
})

Puts the keyboard on day, turning to its month when it is not shown (months shown at once).

Implementation

void focus(DateTime day, {int months = 1}) {
  final d = _clamp(_dateOnly(day));
  _focused = d;
  final m = _monthOf(d);
  if (m.isBefore(_month)) {
    _month = m;
  } else if (!m.isBefore(_monthOf(_addMonths(_month, months)))) {
    _month = _monthOf(_addMonths(m, -(months - 1)));
  }
  notifyListeners();
}