Skip to content

Expose the Scroll Controller of a scrollable TabBar #123965

@Ottavio97

Description

@Ottavio97

Use case

Exposing the Scroll Controller of a TabBar with isScrollable: true, will let developers apply custom behavior based on the scroll.
In my case, it was necessary to apply a Gradient Mask (Container with LinearGradient in Stack) over the TabBar to indicate to the user that there are more elements out of screen.
Example:
image

There was already an issue about it, but it has been closed (#64880)

Proposal

It can be made in many ways, two of them can be:

  • As a parameter, we can provide our own ScrollController. If null, we can check the presence of a PrimaryScrollController. If null, fallback to the _TabBarScrollController already provided
  • Through a key, access to the State of the TabBar, making _scrollController public

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions