Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how we can use two rows in appbar flutter Like first row with title and the second with search input field

enter image description here

Hi There I am working on a app where i need to use two sections in appbar one upper 1->section with logo and some Icons 2-> Search input field below the Title Section.

UI images are attached for better understanding.

like image 637
Farhan Aslam Avatar asked Sep 06 '25 00:09

Farhan Aslam


2 Answers

Just simply create your AppBar as intended, in your screenshot, you don't actually need a second Row. A TextFormField will be enough (you will actually need to customise the InputDecoration as well):

    return AppBar(
      title: Column(children: [
        Row(children: [
          Icon(Icons.menu),
          Text('First row'),
          const Spacer(),
          Icon(Icons.person),
        ]),
        TextFormField(),
      ]),
    );
like image 104
Miguel Ruivo Avatar answered Sep 07 '25 20:09

Miguel Ruivo


You can use the bottom property from the AppBar widget.

AppBar(
    title: YourFirstRowWidget(),
    centerTitle: true,
    bottom: PreferredSize(
        child: YourSearchBarWidget(),
        preferredSize: null),
  )

But you may want to create your own AppBar widget for a perfect result.

like image 44
BLKKKBVSIK Avatar answered Sep 07 '25 20:09

BLKKKBVSIK