Skip to content

Implement SliverDecoration #107498

@Kavantix

Description

@Kavantix

The SliverDecoration widget introduced in PR #107269 is not finished and has at least the following issues:

  1. It doesnt work in horizontal scrollviews
  2. It uses the paintExtent of the child which isn't always the correct value to use, take for instance this example when applying a rounde corner. The bottom two corners shouldn't be rounded yet.

image

  1. Overlap and other advanced properties of slivers aren't accounted for.
  2. The name is inconsistent with the box counterpart DecoratedBox, this should be called DecoratedSliver. The current name suggests its the configuration just like BoxDecoration

The correct behaviour should be the same as using a SliverStack from sliver_tools with a SliverPositioned.fill behind the second child sliver.

Minimal repro example I can add later if needed (dont have time right now).

Proposed resolution steps

  1. Revert [framework] SliverDecoration #107269
  2. Discuss here what sliver features the finished implementation should and shouldnt support
  3. Create extensive widget tests for those cases and reimplement

@Piinks @jonahwilliams FYI

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions