customPopupItemBuilderImage static method

Widget customPopupItemBuilderImage(
  1. BuildContext context,
  2. DropdownModel? item,
  3. bool isSelected
)

Implementation

static Widget customPopupItemBuilderImage(
    BuildContext context, DropdownModel? item, bool isSelected) {
  return Container(
    margin: EdgeInsets.symmetric(horizontal: 8, vertical: 5.h),
    decoration: BoxDecoration(
      border: Border.all(
        color: isSelected
            ? Theme.of(context).primaryColor
            : Get.theme.shadowColor,
      ),
      borderRadius: BorderRadius.circular(10.r),
      color: Get.theme.colorScheme.background,
    ),
    child: ListTile(
      tileColor: Colors.transparent,
      visualDensity: VisualDensity.compact,
      contentPadding: item?.subtitle != null
          ? null
          : EdgeInsets.symmetric(horizontal: 16, vertical: 5.h),
      leading: item?.urlImage == null
          ? null
          : CachedNetworkImage(
              width: 80.w,
              height: 50,
              imageUrl: item?.urlImage ?? "",
              placeholder: (context, url) => LoadingBouncingLine.circle(
                backgroundColor: Get.theme.primaryColor,
              ),
              // errorWidget: (context, url, error) =>  Icon(Icons.error),
            ),
      title: Texts.caption(
        item?.name ?? "-",
        textOverflow: TextOverflow.visible,
      ),
      subtitle: item?.subtitle == null
          ? null
          : Texts.overline(
              item?.subtitle ?? "-",
              textOverflow: TextOverflow.visible,
            ),
      trailing: isSelected
          ? Icon(
              Icons.check_circle,
              color: Get.theme.primaryColor,
            )
          : Icon(
              Icons.circle_outlined,
              color: Get.theme.shadowColor,
            ),
    ),
  );
}