buildListTile method
Implementation
@protected
Widget buildListTile(BuildParameters params) {
Widget? leading = builder.tryBuildWidget(params.context,
params.widgets["leading"], params.state, params.parentContext);
leading ??= params.props["iconCode"] != null
? Icon(IconData(parseInt(params.props["iconCode"]),
fontFamily: 'MaterialIcons'))
: null;
Widget? title = builder.tryBuildWidget(params.context,
params.widgets["title"], params.state, params.parentContext);
title ??= params.props["value"] != null
? Text(properties.getText(params.props["value"], "listTile"))
: null;
Widget? subtitle = builder.tryBuildWidget(params.context,
params.widgets["subtitle"], params.state, params.parentContext);
subtitle ??= params.props["subValue"] != null
? Text(properties.getText(params.props["subValue"], "listTile"))
: null;
ListTileStyle? listTileStyle;
if (params.props["listTileStyle"] != null) {
listTileStyle = params.props["listTileStyle"] == "drawer"
? ListTileStyle.drawer
: ListTileStyle.list;
}
return ListTile(
key: properties.getKey(params.id),
leading: leading,
title: title,
subtitle: subtitle,
trailing: builder.tryBuildWidget(params.context,
params.widgets["trailing"], params.state, params.parentContext),
contentPadding: params.buildProp("contentPadding"),
horizontalTitleGap: tryParseDouble(params.props["horizontalTitleGap"]),
style: listTileStyle,
iconColor: tryParseColor(params.props["iconColor"]),
textColor: tryParseColor(params.props["textColor"]),
tileColor: tryParseColor(params.props["tileColor"]),
focusColor: tryParseColor(params.props["focusColor"]),
hoverColor: tryParseColor(params.props["hoverColor"]),
shape: params.buildProp("shape"),
enabled: parseBool(params.props["enabled"], defaultValue: true),
onTap: events.getFunction(params.context, params.actions["onTap"],
params.state, params.parentContext),
);
}