Stop expanding SliverAppBar on Textfield child receive focus

Issue

I have a textfield for search as SliverAppBar bottom parameter.
In my App, this textfield is only visible when the bar is collapsed. (Achieved using OpacityWidget)
My problem is that every time this field gets focus SliverAppBar will be expanded to full size.
How can I prevent this from happening?

Solution

Turns out adding custom scroll physics solved the problem.

NestedScrollView(
          physics: NeverScrollableScrollPhysics(),
...

User interaction is somehow not blocked and the only visible change was disabled chaotic scrolling when typing to the textfield in SliverBar 👌

Answered By – Heisenbug

Answer Checked By – Cary Denson (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *