renderMenuItems method

List<Widget> renderMenuItems(
  1. TUITheme theme
)

Implementation

List<Widget> renderMenuItems(TUITheme theme) {
  return widget.data
      .map(
        (item) => Material(
          color: Colors.white,
          child: InkWell(
            onTap: () {
              item.onClick();
            },
            child: Container(
              padding: widget.padding ?? const EdgeInsets.all(10),
              child: Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  if (item.icon != null) item.icon!,
                  if (item.icon != null) const SizedBox(
                    height: 4,
                    width: 6,
                  ),
                  Text(
                    item.label,
                    style: TextStyle(
                      decoration: TextDecoration.none,
                      color: theme.darkTextColor,
                      fontSize: 14,
                    ),
                  )
                ],
              ),
            ),
          ),
        ),
      )
      .toList();
}