Shubham Mogarkar
Shubham Mogarkar

Reputation: 293

how to change the shape to SearchBar widget in flutter

I want search bar in a rectangle shape, but corner should be slightly rounded. by default its corder are too rounded. anyone can help me to make its corner customisable. Below is the code I tried.

SearchBar(
                      leading: Icon(Icons.search),
                      hintText: "Search by ID, Store name & etc",
                      shape: MaterialStatePropertyAll<OutlinedBorder>(CircleBorder()),
                    ),
                  ),

Upvotes: 1

Views: 892

Answers (1)

Roshaan Khan
Roshaan Khan

Reputation: 21

Use this instead and customize the border radius according to your preferences:

shape: WidgetStatePropertyAll(
  RoundedRectangleBorder()
),

Upvotes: 2

Related Questions