Skip to content

Wrapping a MenuBar with a ScrollBarTheme does not apply the style for the menu scrollbar #120869

@pmartelletti

Description

@pmartelletti

Following from this comment: #112239 (comment)

If you wrap the newly implemented Menu widget in a ScrollbarTheme widget, the style won't apply for the Menu scrollbar. This happens because the menu is in an overlay, which does not share the context with the Menu widget. Currently, the only way to apply some style to the MenuItem scrollbar is to change it for the whole app.

A solution would be to either allow the MenuItem widget to pass in a scrollbar theme and apply it to the overlay or somehow make the Overlay context the same as the MenuItem. Not sure if any other alternative is feasible, like getting the style from the context and applying it to the Overlay?

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onworkaround availableThere is a workaround available to overcome the issue

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions