Skip to content

Allow focus traversal to leave additional padding when an item is focused within a Scrollable widget #96813

@ds84182

Description

@ds84182

Use case

Some applications would like to maintain extra padding when focusing items with directional or tab focus. Currently, Flutter aligns the top or bottom of the item with the top or bottom of the Scrollable it resides in. Adding additional padding allows applications that mainly depend on directional input to peek items in scrolling lists.

Proposal

  • Add the ability to pass a padding to Scrollable.ensureVisible and ScrollPosition.ensureVisible (breaking change)
  • Add a user-modifiable default padding to FocusManager (defaults to 0)
  • Add a getter on FocusNode to get the padding for ensureVisible to support per-node paddings in the future

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: qualityA truly polished experiencec: new featureNothing broken; request for a new capabilityf: focusFocus traversal, gaining or losing focusf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions