getItemWidget method

Widget getItemWidget(
  1. int index,
  2. ThemeData theme
)

Implementation

Widget getItemWidget(int index, ThemeData theme) {
  final linkData = dataList[index];
  if (dataList.length > 4 &&
      index != 0 &&
      index != dataList.length - 1 &&
      !isExpanded) {
    if (index == 1) {
      return Row(
        children: [
          InkWell(
            onTap: () => onClickExpand,
            child: Container(
              padding: const EdgeInsets.symmetric(horizontal: 12),
              decoration: BoxDecoration(
                color: theme.dividerColor,
                borderRadius: BorderRadius.circular(4),
              ),
              child: Text(
                '...',
                style: TextStyle(
                  fontSize: size == S360fLinkSize.large
                      ? theme.textTheme.headlineSmall?.fontSize
                      : size == S360fLinkSize.small
                      ? theme.textTheme.titleMedium?.fontSize
                      : theme.textTheme.titleLarge?.fontSize,
                  color: theme.disabledColor,
                ),
              ),
            ),
          ),
          Text(
            ' / ',
            style: TextStyle(
              fontSize: getLabelTheme(theme, size),
              fontWeight: FontWeight.w400,
            ),
          ),
        ],
      );
    } else {
      return const SizedBox.shrink();
    }
  }

  return Row(
    children: [
      S360fLink(
        label: linkData.label,
        size: size,
        onPressed: () => {onPressed?.call(linkData)},
        isDisable: linkData.isDisable,
        isUnderline: linkData.isUnderline,
      ),
      if (index == dataList.length - 1)
        const SizedBox.shrink()
      else
        Text(
          ' / ',
          style: TextStyle(
            fontSize: getLabelTheme(theme, size),
            fontWeight: FontWeight.w400,
          ),
        ),
    ],
  );
}