Skip to content

Implement SliverDecoration #107498

Closed
Closed

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

Activity

  1. jonahwilliams commented on Jul 12, 2022

    @jonahwilliams
    Contributor

    I think its likely that using the existing Decoration/BoxDecoration API won't work - in this case we'd need a new decoration class that would allow us to communicate the different sliver-y parts of the paint extent so that we could determine correctly where to use rounded corners

  2. Kavantix commented on Jul 12, 2022

    @Kavantix
    ContributorAuthor

    The way I’ve dealt with it so far in SliverStack is to base the size on the maxPaintExtent. This however might cause painting far outside the visible region.

  3. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: scrollingViewports, list views, slivers, etc.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Jul 13, 2022
  4. changed the title [-]SliverDecoration merged but not finished[/-] [+]Implement SliverDecoration[/+] on Jul 13, 2022
  5. added
    P3Issues that are less important to the Flutter project
    on Jul 13, 2022
  6. added a commit that references this issue on Jun 20, 2023
  7. github-actions commented on Jul 5, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions