gurkan
gurkan

Reputation: 529

flutter rounded corner bottom navigation bar

I have a bottom navigation bar inside in ClipRRect (for giving rounded corner). It has rounded corners but no transparent corners. I am sharing image for showing the problem. How can i do transparent rounded corners?

Code:

bottomNavigationBar: ClipRRect(
        borderRadius: BorderRadius.only(
          topLeft: Radius.circular(30.0),
          topRight: Radius.circular(30.0),
        ),
        child: BottomNavigationBar(
          currentIndex: _selectedIndex,
          selectedItemColor: Colors.amber[800],
          onTap: _onItemTapped,
          items: <BottomNavigationBarItem>[
            BottomNavigationBarItem(
              icon: Icon(Icons.home),
              label: 'Home',
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.search),
              label: 'Search',
            ),
            BottomNavigationBarItem(
              icon: Icon(Icons.person),
              label: 'Profile',
            ),
          ],
        ),
      ),

enter image description here

Upvotes: 5

Views: 4170

Answers (2)

Ardeshir ojan
Ardeshir ojan

Reputation: 2429

try this in your theme

theme: ThemeData(
    canvasColor: Colors.transparent,)

Upvotes: 1

Jim
Jim

Reputation: 7601

Try to reference to my answer, extendBody

Scaffold(
  extendBody: true,

Upvotes: 9

Related Questions