Below is the code I am using:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ListTile(...),
DynamicTreeView(
data: data,
config: Config(
parentTextStyle: kTextGreyNormal.copyWith(color: kColorPrimaryBlue),
rootId: "1",
childrenPaddingEdgeInsets: EdgeInsets.symmetric(vertical: 5.0,horizontal: 5.0),
parentPaddingEdgeInsets: EdgeInsets.only(left: 10, top: 0, bottom: 0)),
onTap: (key) {
//TODO: Close the tree view to its original
Provider.of<ProductListViewModel>(context).getProductListFromCategoryId(key['id']);
},
),
]
)