showSystemSnackBar static method

void showSystemSnackBar({
  1. required IconData icon,
  2. required String message,
  3. Color backgroundColor = Colors.red,
  4. Color textColor = Colors.white,
  5. Duration duration = const Duration(seconds: NumberConst.INDEX_3),
})

Implementation

static void showSystemSnackBar({
  required IconData icon,
  required String message,
  Color backgroundColor = Colors.red,
  Color textColor = Colors.white,
  Duration duration = const Duration(seconds: NumberConst.INDEX_3),
}) {
  ScaffoldMessenger.of(Get.context!).showSnackBar(
    SnackBar(
      content: Row(
        children: [
          Icon(
            icon,
            color: textColor,
            size: NumberConst.SUB_HEADER_FONT_SIZE,
          ),
          SizedBox(width: NumberConst.COMMON_HORIZONTAL_SPACE_2W),
          Flexible(
            child: GNSemiBoldTextWidget(
              title: message,
              fontsize: NumberConst.REGULAR_FONT_SIZE,
              fontcolor: textColor,
            ),
          ),
        ],
      ),
      // hitTestBehavior: ,
      backgroundColor: backgroundColor,
      behavior: SnackBarBehavior.floating,
      duration: duration,
    ),
  );
}