addAndGet method

ScrollController addAndGet()

Creates a new controller that is linked to any existing ones.

Implementation

ScrollController addAndGet() {
  final initialScrollOffset = _attachedControllers.isEmpty
      ? 0.0
      : _attachedControllers.first.position.pixels;
  final controller =
      _LinkedScrollController(this, initialScrollOffset: initialScrollOffset);
  _allControllers.add(controller);
  controller.addListener(_offsetNotifier.notifyListeners);
  return controller;
}