buildListTile method

Widget buildListTile(
  1. BuildContext context,
  2. bool isUnread
)

Implementation

Widget buildListTile(BuildContext context, bool isUnread) {
  final isDarkMode = Theme.of(context).brightness == Brightness.dark;

  return ListTile(
    shape: Border(
      bottom: BorderSide(
        color: isDarkMode
            ? widget.themeConfig?.darkText?.withOpacity(0.5) ??
                Colors.white.withOpacity(0.5)
            : widget.themeConfig?.lightText?.withOpacity(0.5) ??
                Colors.black.withOpacity(0.5),
      ),
    ),
    contentPadding: EdgeInsets.only(
      top: 15,
      left: 20,
      right: 20,
    ),
    tileColor: isUnread
        ? isDarkMode
            ? widget.themeConfig?.darkBackground?.withOpacity(0.6) ??
                Colors.white.withOpacity(0.1)
            : widget.themeConfig?.lightBackground?.withOpacity(0.6) ??
                Colors.black.withOpacity(0.1)
        : Theme.of(context).brightness == Brightness.dark
            ? widget.themeConfig?.darkBackground?.withOpacity(0.2) ??
                Colors.black
            : widget.themeConfig?.lightBackground?.withOpacity(0.2) ??
                Colors.white,
    title: buildTitle(context),
  );
}