Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to set Height to a Drawer Header?

Tags:

flutter

dart

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.

like image 640
Joseph Arriaza Avatar asked Aug 09 '18 13:08

Joseph Arriaza


People also ask

How do you set the height of a drawer header in flutter?

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.

What is a drawer header?

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.

How do you change the shape of a drawer in flutter?

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.


Video Answer


1 Answers

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),     ), ); 
like image 93
Shudipto Trafder Avatar answered Oct 26 '22 10:10

Shudipto Trafder