GetX框架的snackbar

narakuyang
2023-02-27 / 0 评论 / 9 阅读 / 正在检测是否收录...
if (dateTime == null ||
        DateTime.now().difference(dateTime!) > Duration(seconds: 2)) {
      dateTime = DateTime.now();
      Get.snackbar(
        '',
        '',
        titleText: Text(
          '再按一次退出',
          style: TextStyle(
              color: appColor.white,
              fontSize: 15,
              fontWeight: FontWeight.bold),
        ),
        messageText: Text(
          '消息',
          style: TextStyle(
            color: appColor.white,
            fontSize: 12,
            fontWeight: FontWeight.bold,
          ),
        ),
        snackPosition: SnackPosition.TOP,
        barBlur: 5,
        icon: Align(
          alignment: Alignment.center,
          child: SvgPicture.asset(
            myImages.LogoWhite,
            width: 20,
            height: 20,
          ),
        ),
      );
      return false;
    }
    return true;
  },
0

评论

博主关闭了所有页面的评论