I want to create a bottom navigator bar like the image, but when I try the margin for BottomAppBar it is skewed as shown, and I also can't set the background gradient color for BottomAppBar. So how can I margin and set gradient for BottomAppBar? code
Scaffold(
extendBody: true,
body: listPage.elementAt(currentPage),
floatingActionButton: FloatingActionButton(
onPressed: () {
print("click");
},
child: Container(
width: 60,
height: 60,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [yellowGradientColorTop, yellowGradientColorBot])),
child: Center(
child: Image.asset(
"images/icon_paper_pland.png",
height: 25,
width: 25,
),
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: Container(
height: 60,
margin: EdgeInsets.only(left: 15,right: 15, bottom: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
),
child: Center(
child: BottomAppBar(
shape: CircularNotchedRectangle(),
notchMargin: 5,
child: Container(
height: 60,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: MaterialButton(
onPressed: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Icon(Icons.add), Text("data1")],
),
),
),
Expanded(
flex: 1,
child: MaterialButton(
onPressed: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Icon(Icons.add), Text("data1")],
),
),
)
],
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.bottomCenter,
child: Text("data1"),
),
),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
flex: 1,
child: MaterialButton(
onPressed: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Icon(Icons.add), Text("data1")],
),
),
),
Expanded(
flex: 1,
child: MaterialButton(
onPressed: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Icon(Icons.add), Text("data1")],
),
),
)
],
),
)
],
),
),
),
),
),
);
https://img.upanh.tv/2022/09/15/Capturef6618cd0187bda36.png
https://img.upanh.tv/2022/09/15/Screen-Shot-2021-06-16-at-2.30.06-PM.png