I'm looking for a way to set the height to a Drawer Header. I have this DrawerHeader:
DrawerHeader( child: Text('Categories', style: TextStyle(color: Colors.white)), decoration: BoxDecoration( color: Colors.black ), margin: EdgeInsets.all(0.0), ) )
But I don't see a way to set the Height to the Drawer, that's too big.
How to Set Height to a Drawer Header in Flutter? You wrap this with a Container Widget. Code Snippet will look like the below: Container( height: 200.0, child: DrawerHeader( child: Text('Categories', style: TextStyle(color: Colors.
DrawerHeader class Null safety. The top-most region of a material design drawer. The header's child widget, if any, is placed inside a Container whose decoration can be passed as an argument, inset by the given padding. Part of the material design Drawer. Requires one of its ancestors to be a Material widget.
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.
You wrap this with a Container
widget.
const SizedBox( height: 10.0, child: DrawerHeader( child: Text('Categories', style: TextStyle(color: Colors.white)), decoration: BoxDecoration(color: Colors.black), margin: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0), ), );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With