I'm trying to make the question simple. I need to make a Drawer
, It gives me below error:
RenderFlex children have non-zero flex but incoming height constraints are unbounded
I want the drawer to have 3 sections:
|--------------------------------|
| |
| DrawerHeader |
| |
|--------------------------------|
|--------------------------------|
| |
| Scrollable Area |
| |
| ListItem1 |
| ListItem2 |
| ListItem3 |
| |
| |
|--------------------------------|
|--------------------------------|
| |
| Copyright Section |
| |
|--------------------------------|
Drawer(
child : Column(
children: [
DrawerHeader(
padding: const ..,
child: ....,
),//DrawerHeader
Expanded(
child: ListView(
children: const [
ListTile(
leading: ...,
title: ...,
),//ListTile
ExpansionTile(
title: ...,
children: <Widget>[
ListTile(
leading: ...,
title: ...,
),//ListTile
ListTile(
leading: ...,
title: ...,
),//ListTile
...
], //<Widget>
),//ExpansionTile
Divider(thickness: 1),
],//children
),//ListView
),//Expanded
const SizedBox(height: kSpacing * 2),
const Text("Copyright. All Rights Reserved"),
const SizedBox(height: kSpacing),
],//children
),//Column
);//Drawer
I've tried more that 8 solution that came up from 4 days searching. here are some examples
Error
Failed assertion: line 2817 pos 12: '!_needsLayout'
Error
Failed assertion: line 1979 pos 12: 'hasSize'
Error
RenderFlex children have non-zero flex but incoming height constraints are unbounded
And tried removing Expanded
, use SingleChildScrollView
but still doesn't work for me