Skip to content

Document how NestedScrollView.physics/scrollDirection/reverse affect outer/inner scroll views #45619

@xinle

Description

@xinle

I read code ,find this code in scrollable.dart

void _updatePosition() {
   _configuration = ScrollConfiguration.of(context);
   _physics = _configuration.getScrollPhysics(context);
   if (widget.physics != null)
     _physics = widget.physics.applyTo(_physics);
   final ScrollController controller = widget.controller;
   final ScrollPosition oldPosition = position;
   if (oldPosition != null) {
     controller?.detach(oldPosition);
     // It's important that we not dispose the old position until after the
     // viewport has had a chance to unregister its listeners from the old
     // position. So, schedule a microtask to do it.
     scheduleMicrotask(oldPosition.dispose);
   }

   _position = controller?.createScrollPosition(_physics, this, oldPosition)
     ?? ScrollPositionWithSingleContext(physics: _physics, context: this, oldPosition: oldPosition);
   assert(position != null);
   controller?.attach(position);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/d: examplesSample code and demosd: stackoverflowGood question for Stack Overflowf: scrollingViewports, list views, slivers, etc.found in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions