0

I'm new on flutter and i have a problem. When i click on the textformField, this one disappears

I put in red the container but normaly it's transparent

I put a stack, then in the background the GoogleMap which is extend. And to have a research effect I put an overlay with the textformfield and I will have specific filter buttons instead of the yellow and green.

The problem is that when I click on the textformfield, it disappears from the screen. I tried to play with the SingleChildScrollView, ListView, but I still have errors especially because of GoogleMap which takes up all the space Everything is contained by a Scaffold

Can you help me please, where to give me a solution? I enclose the code below

cordially

enter image description here

enter image description here

return Stack( children: [ /// GoogleMap Column( children: [ Expanded( child: GoogleMap(initialCameraPosition: _kInitialPosition), ), ], ),

    /// Search Bar And Filter
    Positioned.fill(
      bottom: _searchBarContainer,
      child: SafeArea(
        child: Container(
          color: Colors.red,
          child: Padding(
            padding: const EdgeInsets.only(left: 8.0, right: 8.0),
            child: Row(
              children: [
                /// Search Bar
                Expanded(
                  child: TextFormField(
                    decoration: DesignWidget.inputDecorationTexFieldMap(
                        _searchBarMap, Icons.search),
                  ),
                ),

                /// Filter
                Container(
                  width: _filterContainer,
                  color: Colors.green,
                  child: Row(
                    children: [
                      Container(
                        color: Colors.yellow,
                        width: _filterContainer / 2,
                      ),
                      Container(
                        color: Colors.green,
                        width: _filterContainer / 2,
                      )
                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    ),
  ],
);

3 Answers3

0

simply user this pakage [material_floating_search_bar: ^0.3.4]

0

I think before you use textFormField you either have to define a key or controller.....it happens when you don't define an instance of controller and use that controller inside of textFormField controller.

Milan Poudel
  • 602
  • 1
  • 9
  • 20
0

Okay i found the solution I need to add (to Scallfold) : resizeToAvoidBottomInset: false