Change Flutter Drawer corner radius

You can try to wrap Drawer in ClipRRect

ClipRRect(
  borderRadius: BorderRadius.vertical(top: Radius.circular(4.0)),
  child: Drawer(...),
)

Drawer in Flutter already have a shape property which can be used to change the shape of drawer. Below is the code to change corner radius of Drawer:

         Drawer(
            shape: const RoundedRectangleBorder(
              borderRadius: BorderRadius.only(
                  topRight: Radius.circular(20),
                  bottomRight: Radius.circular(20)),
            ),
            child: .....
          ),

There is no need of wrapping drawer around any widget.


Found the solution. Just have to add canvasColor: Colors.transparent to the MaterialApp theme and it will work.

Tags:

Flutter