fluttercurveclipclip-pathbottom-navigation-bar

how to make curved from the top Flutter bottom navigation bar


I want to make this curved bottom nav bar in Flutter
enter image description here
but what I'm getting is this
enter image description here
I'm using ClipRRect to do it but it's not what I need, and here is my code

      bottomNavigationBar: Container(
        decoration: const BoxDecoration(
          borderRadius: BorderRadius.only(topRight: Radius.circular(500),topLeft: Radius.circular(500),),
          color: Color(0xfff2f2f2),
          boxShadow: [
            BoxShadow(
              color: Colors.grey,
              offset: Offset(5.0, 10.0), //(x,y)
              blurRadius: 20.0,
            ),
          ],
        ),
        child: ClipRRect(
          borderRadius: const BorderRadius.only(topRight: Radius.circular(500),topLeft: Radius.circular(500),),
          child: BottomNavigationBar(
            items: [
              BottomNavigationBarItem(icon: Image.asset(logo,height: HDW().fullHeight(context: context,height: 0.1),color: darkGreen,),label: ''),
              BottomNavigationBarItem(icon: Image.asset(logo,height: HDW().fullHeight(context: context,height: 0.1),color: darkGreen,),label: ''),
            ],
          ),
        ),
      ),


Solution

  • You can use the CustomPaint widget, with it you can build any shape that you want in Flutter

    This video can help you to design and implement a custom shape for the bottom navigation bar.

    Link: Flutter - Custom Shaped Bottom Navigation Bar