YListTile function

Widget YListTile(
  1. String title,
  2. String? image,
  3. dynamic onClick(), {
  4. Color bgColor = Colors.transparent,
  5. double imageSize = 20,
  6. Widget? right,
  7. EdgeInsets? padding,
  8. TextStyle? titleStyle,
  9. bool enable = true,
})

列表条目

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,
    ),
  );
}