listData method

Widget listData(
  1. dynamic context,
  2. bool isWeb
)

Implementation

Widget listData(context, bool isWeb) {
  try {
    return Container(
      color: color,
      child: ListView(
        children: [
          if (!isWeb) ...{
            Container(
              width: double.infinity,
              height: 55,
              padding: const EdgeInsets.only(right: 20, left: 10,top: 10,bottom: 10),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  IconButton(
                    onPressed: () {
                      Navigator.of(context).pop(null);
                    },
                    icon: Icon(
                      menuIcon,
                      color: _decidedColor,
                    ),
                  ),
                  const SizedBox(
                    width: 10,
                  ),
                  Expanded(
                      child: Container(
                    alignment: AlignmentDirectional.centerStart,
                    child: appTitle,
                  ))
                ],
              ),
            )
          },
          for (QonvexItem item in items) ...{
            if ((!isWeb || (isWeb && isToggled))) ...{
              MaterialButton(
                padding: EdgeInsets.symmetric(
                    horizontal: !isWeb || (isWeb && isToggled) ? 20 : 0,
                    vertical: 25),
                onPressed: () {
                  if (!isWeb) {
                    Navigator.of(context).pop(null);
                  }
                  onPressed(item.child);
                },
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Icon(
                      item.icon,
                      color: _decidedColor,
                    ),
                    if (!isWeb || (isWeb && isToggled)) ...{
                      const SizedBox(
                        width: 10,
                      ),
                      Expanded(
                        child: Text(
                          "${item.title}",
                          style: TextStyle(color: _decidedColor),
                        ),
                      )
                    }
                  ],
                ),
              ),
            } else ...{
              Tooltip(
                message: "${item.title}",
                child: MaterialButton(
                  padding: EdgeInsets.symmetric(
                      horizontal: !isWeb || (isWeb && isToggled) ? 20 : 0,
                      vertical: 25),
                  onPressed: () {
                    if (!isWeb) {
                      Navigator.of(context).pop(null);
                    }
                    onPressed(item.child);
                  },
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Icon(
                        item.icon,
                        color: _decidedColor,
                      ),
                      if (!isWeb || (isWeb && isToggled)) ...{
                        const SizedBox(
                          width: 10,
                        ),
                        Expanded(
                          child: Text(
                            "${item.title}",
                            style: TextStyle(color: _decidedColor),
                          ),
                        )
                      }
                    ],
                  ),
                ),
              )
            }
          }
        ],
      ),
    );
  } catch (e) {
    throw e;
  }
}