Repository navigation
Closed
flutter/packages
#13360Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: themingStyling widgets with a themeStyling widgets with a themehas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to reproduce
Override the SearchBarTheme's padding property and place a SearchBar and a SearchAnchor.bar in the same screen.
Expected results
Both the SearchBar and SearchAnchor.bar should inherit the padding from the theme.
Actual results
SearchAnchor.bar does not respect the theme. Instead, when the barPadding property is null, it defaults to a const MaterialStatePropertyAll<EdgeInsets>(EdgeInsets.symmetric(horizontal: 16.0)), as seen in _SearchAnchorWithSearchBar.
That default value should be removed. However, I didn't know if this was indented, so I thought it best to report it as a potential bug from some older refactor.
Code sample
Code sample
SearchBarTheme(
data: const SearchBarThemeData(
padding: WidgetStatePropertyAll(EdgeInsets.all(16)),
),
child: Column(
children: [
const SearchBar(),
SearchAnchor.bar(
suggestionsBuilder: (context, controller) => const [],
),
],
),
);Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[√] Flutter (Channel stable, 3.41.9, on Microsoft Windows [Version 10.0.26200.8246], locale en-US) [227ms]
• Flutter version 3.41.9 on channel stable at C:\dev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 00b0c91f06 (2 days ago), 2026-04-29 10:03:19 -0700
• Engine revision 42d3d75a56
• Dart version 3.11.5
• DevTools version 2.54.2
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migrationMetadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: themingStyling widgets with a themeStyling widgets with a themehas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
saurabh-mirajkar commentedon May 4, 2026
@HeftyCoder Thanks for the report. Labelling for
team-designto investigate further.MarlonJD commentedon May 18, 2026
Proposed fix is in #186666. It is based on
master, includes regression coverage for themed padding and explicitbarPaddingoverride, and local analyze/test passed. Current remaining blockers are review,CICDlabel, and Google testing.[Material] Fix SearchAnchor.bar ignoring SearchBarThemeData.padding
[Material] Fix SearchAnchor.bar ignoring SearchBarThemeData.padding
QuncCccccc commentedon Jun 10, 2026
This issue has been fixed by #186037. The PR is still open because we are in code freeze now so the PR cannot land it. That' said, we don't need more PRs for this one. Thanks everyone's contribution:)!
[Material] Fix SearchAnchor.bar ignoring SearchBarThemeData.padding
[Material] Fix SearchAnchor.bar ignoring SearchBarThemeData.padding
[material_ui] Make SearchAnchor.bar respect SearchBarThemeData padding (