• Kate Lovett's avatar
    Add optional axis specifier to static scrollable methods (#124894) · e867d1c6
    Kate Lovett authored
    This is motivated by part of the 2D scrolling proposal: [flutter.dev/go/2D-Foundation](https://flutter.dev/go/2D-Foundation)
    
    This is one of the last little PRs to prep for the 2D scrolling foundation. 
    This adds an optional `axis` parameter to the static Scrollable methods `[of, maybeOf, recommendDeferredLoadingForContext]`. This allows developers that are nesting scrollables (or one day using 2D scrolling) to look them up instead by a particular axis.
    
    In general, even outside the context of 2D, I think this is helpful. I am often asked how to get the outer scrollable when nesting. Now it can be done.
    
    There is also a small semantic refactor here in ScrollableState.build, this just creates a private method (_buildChrome) that will be overridden in 2D later. It is easier to add now than in the really big PR that will be.
    e867d1c6
scrollable.dart 61.1 KB