listViewOfListTile method
YYDialog
listViewOfListTile({
- List<
ListTileItem> ? items, - double? height,
- dynamic isClickAutoDismiss = true,
- dynamic onClickItemListener()?,
Implementation
YYDialog listViewOfListTile({
List<ListTileItem>? items,
double? height,
isClickAutoDismiss = true,
Function(int)? onClickItemListener,
}) {
return this.widget(
Container(
height: height,
child: ListView.builder(
padding: EdgeInsets.all(0.0),
shrinkWrap: true,
itemCount: items?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
return Material(
color: Colors.white,
child: InkWell(
child: ListTile(
onTap: () {
if (onClickItemListener != null) {
onClickItemListener(index);
}
if (isClickAutoDismiss) {
dismiss();
}
},
contentPadding: items?[index].padding,
leading: items?[index].leading,
title: Text(
items?[index].text ?? "",
style: TextStyle(
color: items?[index].color,
fontSize: items?[index].fontSize,
fontWeight: items?[index].fontWeight,
fontFamily: items?[index].fontFamily,
),
),
),
),
);
},
),
),
);
}