I've spent a lot of time googling on how I can achieve this but failed, maybe I'm googling it wrong, I tried using path, but failed.
I just want all items to change colors only when pressed, and the center docked will retain its shape and everything.
Please anyone who can shade some lights on this will be appreciated. Thank you
Here what I've tried to put together with google help. I just want to get exactly like what is shown on the attachment but my knowledge is limited at the moment.
return Scaffold(
backgroundColor: Color(0xFFFFFFFF),
bottomNavigationBar: Material(
color: Colors.transparent,
elevation: 100,
child: ClipPath(
child: SizedBox(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
IconButton(
icon: Icon(
Icons.home,
color: Colors.deepPurple,
size: 30,
),
onPressed: () {
setState() {}
}),
IconButton(
icon: Icon(
Icons.branding_watermark,
size: 30,
color: Colors.black54,
),
onPressed: () {}),
SizedBox(
width: 50,
),
IconButton(
icon: Icon(
Icons.cloud_download,
size: 30,
color: Colors.black54,
),
onPressed: () {}),
IconButton(
icon: Icon(
Icons.face,
size: 30,
color: Colors.black54,
),
onPressed: () {}),
],
)),
height: 100,
width: double.infinity,
),
clipper: CurveDraw(),
),
),
floatingActionButton: MaterialButton(
color: Colors.deepPurple,
padding: EdgeInsets.all(20),
onPressed: () {},
shape: CircleBorder(),
child: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
);
Curve
getClip(Size size) {
double sw = size.width;
double sh = size.height;
double gapConst = 50;
Path path = Path();
path.moveTo(0, sh);
path.lineTo(0, sh / 2);
path.quadraticBezierTo(0, 0, sh / 2, 0); //1st curve
path.lineTo(sw / 2 - sw / 5, 0);
path.cubicTo(sw / 2 - sw / 8, 0, sw / 2 - sw / 8, sh / 2, sw / 2, sh / 2);
path.cubicTo(
sw / 2 + sw / 8, sh / 2, sw / 2 + sw / 8, 0, sw / 2 + sw / 5, 0);
path.lineTo(sw - sh / 2, 0);
path.quadraticBezierTo(sw, 0, size.width, sh / 2);
path.lineTo(sw, sh);
path.close();
// rotate the path around the x-axis (flip it upside down)
path.transform(Matrix4.rotationX(pi));
return path;
}