getSelectionTile method
Implementation
Widget getSelectionTile(int index) {
return Visibility(
visible:
searchKeyWord.isEmpty ||
list[index].label.toLowerCase().contains(searchKeyWord.toLowerCase()),
child: Material(
color: AppTheme.themeColors.themeBlue,
child: InkWell(
onTap: list[index].isDisabled
? null
: () {
onItemTap!(list[index].id);
FocusManager.instance.primaryFocus?.unfocus();
},
child: Container(
height: list[index].isDisabled ? 45 : 41,
padding: const EdgeInsets.only(left: 20, right: 5),
color: list[index].isDisabled
? UFUColor.lightGray
: UFUColor.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
list[index].child != null
? Container(
margin: const EdgeInsets.only(right: 20),
child: UFUAvatar(
borderColor:
list[index].borderColor ??
UFUColor.transparent,
backgroundColor: list[index].color,
size: UFUAvatarSize.small,
child: list[index].child,
),
)
: const SizedBox.shrink(),
Flexible(
child: Row(
children: [
if (list[index].prefixLabel != null) ...{
UFUText(
text: list[index].prefixLabel!,
overflow: TextOverflow.ellipsis,
fontWeight: UFUFontWeight.medium,
),
},
Flexible(
child: UFUText(
text: list[index].label,
overflow: TextOverflow.ellipsis,
),
),
if ((!(list[index].active ?? true) &&
showInactiveUserLabel))
UFUText(
text: ' (Inactive)',
textColor: AppTheme.themeColors.red,
overflow: TextOverflow.ellipsis,
),
if (list[index].suffixLabel != null) ...{
const SizedBox(width: 5),
UFUText(
text: list[index].suffixLabel!,
textSize: UFUTextSize.heading4,
overflow: TextOverflow.ellipsis,
textColor:
AppTheme.themeColors.secondaryText,
),
},
],
),
),
],
),
if (list[index].isDisabled) ...{
const SizedBox(height: 2),
UFUText(
text: list[index].disableMessage ?? '',
textColor: AppTheme.themeColors.darkGray,
textSize: UFUTextSize.heading5,
),
},
],
),
),
UFUCheckbox(
selected: list[index].isSelect,
onTap: list[index].isDisabled
? null
: (value) {
onItemTap!(list[index].id);
},
disabled: list[index].isDisabled,
borderColor: AppTheme.themeColors.primary,
color: AppTheme.themeColors.primary,
checkColor: AppTheme.themeColors.base,
),
],
),
),
),
),
);
}