YListTile function
列表条目
Implementation
Widget YListTile(
String title,
String? image,
Function() onClick, {
Color bgColor = Colors.transparent,
double imageSize = 20,
Widget? right,
EdgeInsets? padding,
TextStyle? titleStyle,
bool enable = true,
}) {
return Container(
color: bgColor,
child: _YFlatButton(
Container(
padding: padding ?? const EdgeInsets.all(15),
child: Row(
children: <Widget>[
image != null ? Image.asset(image, width: imageSize, height: imageSize, fit: BoxFit.fill) : YEmpty(),
Expanded(child: Container(margin: EdgeInsets.fromLTRB(image != null ? 10 : 0, 0, 0, 0), child: Text(title, style: titleStyle ?? const TextStyle(fontSize: 15)))),
right ?? const Offstage(offstage: true),
],
),
),
onClick: onClick,
enable: enable,
),
);
}