Reputation: 760
I've created a Drawer widget in flutter, but the DrawerHeader widget I've listed as one of its children takes up more vertical space than I want.
From DrawerHeader's properties here, it looks like the margin
property might be responsible for size, but I'm stuck on how to use the EdgeInsetsGeometry
widget since its constructor is abstract.
I've included code that is similar to mine below:
return Scaffold(
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
// want to use margin property in DrawerHeader widget
DrawerHeader(child: Text("Header"))
],
)
)
...
);
Upvotes: 1
Views: 493
Reputation: 276947
EdgeInsetsGeometry
is just an abstract class.
One concrete implementation is EdgeInsets
:
DrawerHeader(
margin: const EdgeInsets.all(8.0),
)
Upvotes: 1