Repository: flutter
Issue: How to make ScrollTransitions as in SwiftUI in Flutter
Labels: c: new feature,framework,f: scrolling,would be a good package,P3,team-framework,triaged-framework

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Use case

### Context

SwiftUI introduced a great way to make beautiful scroll transitions easily as in the video below:

https://github.com/flutter/flutter/assets/9378033/274e44d0-6dc1-4f67-8158-0a6cc9486b7e

This video comes from this tweet: https://twitter.com/i/status/1666854635796148244

We can find the API documentation [here](https://developer.apple.com/documentation/swiftui/view/scrolltransition(topleading:bottomtrailing:axis:transition:)).

The code simply looks like this (this is not the code for the video above, it's just to display some code).
```swift
CellView()
    .idView(i)
    .scrollTransition(.animated) { content, phase in
        content
            .scaleEffect(phase != .identity ? 0.6 : 1)
            .opacity(phase != .identity ? 0.3 : 1)
    }
```

I don't this think we can do this as easily in Flutter today.

### Requirements
- Add the API primitives to let a child get rendering information from one of its parents and keep it in sync.
- It should be done in the same frame the child is rendered
- We should be able to have it through children of a `SliverList`. So a solution based only on Slivers does not work. 

### First ideas
I wanted to see how to tackle this.

First I thought it would be possible to pass a different constraint type when calling the `layout` method of the `child` in the appropriate `RenderObject`. Then with a specific `LayoutBuilder` it would have been possible to get the scroll information.
But it can't work because we need to have the size of the child in order to compute the visible portion of the child within the scrollview.

So because we need the size of the child, we can't do it before the painting phase.
I looked at how we could pass information through the `PaintingContext` class, I thought about creating a `DelegatingPaintingContext` (which would proxy all the method to an inner `PaintingContext` instance) and add it some additional information concerning the scroll information.
Sadly it cannot be done outside the library where `PaintingContext` is. Moreover, I'm not sure the instance of the painting context is the same for all children in the tree. If a new instance (from `PaintingContext`) is created before the appropriate child get it, it won't work.

Another solution could be to do it at the compositing level by adding some layers, but I'm not sure it would be the best way to tackle this.

Maybe you could help me to choose the best direction to add this feature to Flutter. Through an external package if there is already a way to do it in Flutter I'm not aware of, or I can create a PR in Flutter if I have enough information to start working on this.

If I don't provided enough information, let me know and I'll update the description here.

### Proposal

For the moment I don't have a proposal.