Reputation: 115
I want to create a rounded Bottomappbar like this one.
Rounded BottomAppBar:
But it appears like this... Coded BottomAppBar:
How do I get rid of that white portion?
return ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(25),
topRight: Radius.circular(25),
bottomRight: Radius.circular(25),
bottomLeft: Radius.circular(25),
),
child: Padding(
padding: const EdgeInsets.only(bottom:20.0),
child: BottomAppBar(
shape: CircularNotchedRectangle(),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () {},
),
IconButton(
icon: Icon(Icons.search),
color: Colors.white,
onPressed: () {},
),
],
),
color: Colors.blueGrey,
),
)
); ```
Upvotes: 5
Views: 7285
Reputation: 115
As @Jagadish suggested I used Shape: RoundedRectangleBorder
to get rounded BottomAppBar.
However to get notched bar I used:
shape: AutomaticNotchedShape(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(25),
),
StadiumBorder(),
),
... //Codes=
),
This also gives a notch for Extended Floating Action Button and (I think) for Buttons with diff shapes.
Upvotes: 4
Reputation: 1186
App bar widget has a shape property and that's what you should use to get desired results, change your code to this
BottomAppBar(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
topLeft: Radius.circular(25),
topRight: Radius.circular(25),
bottomRight: Radius.circular(25),
bottomLeft: Radius.circular(25),
),
),
... //Your codes
),
Upvotes: 3