push method Null safety

ScrollController push()

Implementation

ScrollController push() {
  final controller = _PairedScrollController(this);
  _actors.add(controller);
  controller.addListener(_offsetNotifier.notifyListeners);

  if (_actors.isNotEmpty) {
    _actors.last.removeListener(_offsetNotifier.notifyListeners);
    _actors.last.addListener(_offsetNotifier.notifyListeners);
  }

  return controller;
}