buildLineCell function
Widget
buildLineCell(
{ - required String title,
- Widget? titleChild,
- Widget? subTitle,
- Icon? icon,
- String? svgName,
- String? iconName,
- String? numString,
- bool showNext = true,
- Color color = Colors.white,
- Color titleColor = Colors.black,
- bool showLine = false,
- VoidCallback? onPressed,
})
Implementation
Widget buildLineCell(
{required String title,
Widget? titleChild,
Widget? subTitle,
Icon? icon,
String? svgName,
String? iconName,
String? numString,
bool showNext = true,
Color color = Colors.white,
Color titleColor = Colors.black,
bool showLine = false,
VoidCallback? onPressed}) {
Widget iconWidget = icon ??
(svgName != null
? SvgPicture.asset(
svgName,
width: 24,
height: 24,
)
: (iconName != null ? Image.asset(iconName) : Container()));
return Material(
color: color,
child: Ink(
color: color,
child: InkWell(
onTap: onPressed,
child: Column(
children: <Widget>[
Container(
height: 60,
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
children: <Widget>[
iconWidget,
const SizedBox(width: 11),
Expanded(
child: titleChild ??
Text(
title,
style: TextStyle(fontSize: 18, color: titleColor),
overflow: TextOverflow.ellipsis,
softWrap: false,
),
),
if (subTitle != null) ...{
subTitle,
} else if (numString != null) ...{
Text(
numString,
style: const TextStyle(fontSize: 16),
),
},
if (showNext) ...{
Icon(
MdiIcons.chevronRight,
color: Colors.grey[600],
),
},
],
),
),
Container(
height: showLine == true ? 1 : 0.0,
color: MiniColor.lightGray,
margin: const EdgeInsets.only(left: 60),
),
],
),
),
),
);
}