I was trying to find a way to add sub-menus to this drawer and to collapse them on tap. Ie: I want to call this widget with a title and 3 subtitles like :
- Flutter
- List item
- List item
- List item
Any help would be appreciated. Thank you.
class DrawerListTile extends StatelessWidget {
const DrawerListTile({
Key key, @required this.title,@required this.svgSrc,@required this.press,
}) : super(key: key);
final String title,svgSrc;
final VoidCallback press;
@override
Widget build(BuildContext context) {
return ListTile(
onTap:press,
horizontalTitleGap: 0.0,
leading: SvgPicture.asset(
svgSrc,
color: Colors.black,
height:16,
),
title:Text(
title,
style: TextStyle(color: Colors.black),
),
trailing: Icon(Icons.arrow_drop_down,size:15),
);
}
}