Friends, my codes are as follows, but I get the error I wrote in the title on line 51, which is the drawer. I would appreciate your help.
I marked the part with the error
2
NavigationDrawer required parameter children, add this parameter like below
NavigationDrawer
children
drawer: const NavigationDrawer( children: [], ),
For drawer you have provide required children parameter
drawer: const NavigationDrawer( children: <Widget>[ //widgets here ], ),
you can also accomplish drawer by using Drawer widget I have used ListView as child of Drawer
drawer: Drawer( backgroundColor: kPrimaryBackGroundColor, child: ListView( children: [ NavHeader(), const Divider( color: kPrimaryBorderColor, ), DrawerItem("About Us", Icons.local_offer_outlined , AboutUs()), DrawerItem("Account", Icons.account_circle, ProfileScreen()), DrawerItem("Stats", Icons.query_stats, UserStats()) ], ), )
,
Click here to cancel reply.
2
Answers
NavigationDrawer
required parameterchildren
, add this parameter like belowFor drawer you have provide required children parameter
you can also accomplish drawer by using Drawer widget
I have used ListView as child of Drawer
,