Skip to content

[SearchAnchor.bar] Flutter M3 SearchAnchor.bar position issue. #126542

@Patrick386

Description

@Patrick386

Is there an existing issue for this?

Steps to reproduce

  1. Flutter Web
  2. SearchAnchor.bar() widget
  3. Tap

Expected results

The position of the search bar and the popup do not match.
Additionally, SearchAnchorTheme does not exist; instead, there is SearchViewTheme.
What is the method to adjust the position and size?

Actual results

The position of the search bar and the popup do not match.

Code sample

Code sample
[
class PinnedSearchBarApp extends StatefulWidget {
  const PinnedSearchBarApp({super.key});

  @override
  State<PinnedSearchBarApp> createState() => _PinnedSearchBarAppState();
}

class _PinnedSearchBarAppState extends State<PinnedSearchBarApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SizedBox(
           width: MediaQuery.of(context).size.width * 0.4,
          child: SearchAnchor.bar(
            suggestionsBuilder:
                (BuildContext context, SearchController controller) {
              return List<Widget>.generate(
                5,
                (int index) {
                  return ListTile(
                    titleAlignment: ListTileTitleAlignment.center,
                    title: Text('Initial list item $index'),
                  );
                },
              );
            },
          ),
        ),
      ),
    );
  }
}
]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

2023-05-11.10.31.39.mov

Logs

Logs
[-]

Flutter Doctor output

Doctor output
[Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.0, on macOS 13.0 22A380 darwin-arm64 (Rosetta), locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.4)
[✓] VS Code (version 1.71.1)
[✓] VS Code (version 1.75.1)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions