flutter_animate icon indicating copy to clipboard operation
flutter_animate copied to clipboard

Make it easier to set ScrollAdapter begin/end relative to a specific widget

Open gskinner opened this issue 3 years ago • 1 comments
trafficstars

When creating scroll driven animations, it is often a lot easier to set anchor points relative to an element in the scroll region (versus absolute pixel values). This is especially true with dynamic or responsive content.

Quick sketch follows for illustration, naming and implementation specifics TBD.

ScrollAdapter(
  begin: ScrollAdapter.getPosition(myWidget, alignment: Alignment.center, offset: Offset(y: -100),
  ...
)

The above would set the begin property to 100px above the middle of myWidget.

gskinner avatar Sep 28 '22 18:09 gskinner

It's worth considering whether there's a use case for a version of this that adjusts automatically if the position of the widget changes (the example above wouldn't).

gskinner avatar Sep 28 '22 18:09 gskinner