0

In App bar i added search widget like this:

return Scaffold(
  appBar: AppBar(
    title: Container(
      margin: EdgeInsets.only(top: 30),
      decoration: BoxDecoration(
        color: Color.fromARGB(50, 255, 255, 255),
        borderRadius: BorderRadius.all(Radius.circular(20)),
      ),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Expanded(
            child: Padding(
              padding: const EdgeInsets.symmetric(horizontal: 5.0),
              child: TextFormField(...
                    )),
              ),
            ),
          )
        ],
      ),
    ),
    bottom: PreferredSize(
      preferredSize: Size.fromHeight(100.0),
      child: TabBar(...

I added margin from top equal 30 but search section is cropped:

enter image description here

How can i increase default title size in appbar?

Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149

2 Answers2

1

You can use flexibleSpace instead of title.

return Scaffold(
  appBar: AppBar(
    flexibleSpace: Container(....
Lunedor
  • 1,410
  • 1
  • 14
  • 33
0

flexibleSpace works fine but another way is to use PreferredSize.

Scaffold(
  appBar: PreferredSize(
    preferredSize: Size.fromHeight(100.0),
    child:AppBar(
      title:Text("title"),
    )
  ),
  body:...
 )
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Adnan karim
  • 1,009
  • 10
  • 15