showCustomSnackbar1 static method

void showCustomSnackbar1(
  1. String message, {
  2. bool isError = false,
})

Implementation

static void showCustomSnackbar1(String message, {bool isError = false}) {
  Get.showSnackbar(
    GetSnackBar(
      padding: EdgeInsets.all(SizeConstant.getHeightWithScreen(10)),
      messageText: Row(
        children: [
          SizedBox(width: SizeConstant.getHeightWithScreen(12)),
          Text(
            message,
            style: TextStyle(
              color: isError ? ColorConstant.white : ColorConstant.black3,
              fontSize: SizeConstant.xSmallFont,
            ),
          ),
        ],
      ),
      backgroundColor: isError ? ColorConstant.red3 : ColorConstant.green5,
      snackPosition: SnackPosition.TOP,
      borderRadius: SizeConstant.getHeightWithScreen(10),
      borderColor: isError ? ColorConstant.red : ColorConstant.green6,
      margin: EdgeInsets.only(
        left: SizeConstant.getHeightWithScreen(16),
        right: SizeConstant.getHeightWithScreen(16),
        bottom: SizeConstant.getHeightWithScreen(1),
      ),
      icon: Container(
        height: SizeConstant.getHeightWithScreen(20),
        width: SizeConstant.getHeightWithScreen(20),
        decoration: BoxDecoration(
          color: isError ? ColorConstant.red : ColorConstant.green4,
          shape: BoxShape.circle,
        ),
        padding: EdgeInsets.all(
          SizeConstant.getHeightWithScreen(5),
        ),
        child: Icon(
          isError ? Icons.clear : Icons.check,
          color: ColorConstant.white,
          size: SizeConstant.getHeightWithScreen(10),
        ),
      ),
      duration: const Duration(seconds: 2),
    ),
  );
}