menuCard static method

Widget menuCard(
  1. IconCardItem iconCard,
  2. VoidCallback functionHanler, {
  3. bool useCard = true,
  4. bool isSuspend = false,
  5. VoidCallback? suspendHanler,
})

Implementation

static Widget menuCard(
  IconCardItem iconCard,
  VoidCallback functionHanler, {
  bool useCard = true,
  bool isSuspend = false,
  VoidCallback? suspendHanler,
}) {
  final width = Get.width.w;

  return Material(
    color: Colors.transparent,
    child: InkWell(
      splashColor: Get.theme.primaryColor.withAlpha(100),
      onTap: functionHanler,
      // onTap: isSuspend ? suspendHanler : functionHanler,
      child: FittedBox(
        fit: BoxFit.scaleDown,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Container(
              decoration: !useCard
                  ? null
                  : BoxDecoration(
                      color: Get.theme.colorScheme.background,
                      borderRadius:
                          const BorderRadius.all(Radius.circular(10)),
                      boxShadow: [
                        BoxShadow(
                          color: Get.theme.shadowColor,
                          offset: const Offset(0.0, 1.0), //(x,y)
                          blurRadius: 1.0,
                        ),
                      ],
                    ),
              foregroundDecoration: !isSuspend
                  ? null
                  : const BoxDecoration(
                      color: Colors.blueGrey,
                      backgroundBlendMode: BlendMode.saturation,
                    ),
              child: Padding(
                padding:
                    useCard ? const EdgeInsets.all(10.0) : EdgeInsets.zero,
                child: iconCard.isIcon
                    ? Icon(
                        iconCard.iconData,
                        color: Get.theme.primaryColor,
                        size: 30,
                      )
                    : Image(
                        width: width / 10,
                        height: width / 10,
                        image: AssetImage(iconCard.imageAsset),
                      ),
              ),
            ),
            useCard
                ? const SizedBox(
                    height: 5,
                  )
                : const SizedBox(
                    height: 3,
                  ),
            Texts.overline(
              iconCard.label,
              textAlign: TextAlign.center,
            ),
          ],
        ),
      ),
    ),
  );
}