showAlertSnackbar method

void showAlertSnackbar(
  1. String message, {
  2. String? buttonText,
  3. void buttonOnPressed()?,
})

Implementation

void showAlertSnackbar(String message,
    {String? buttonText, void Function()? buttonOnPressed}) {
  Get.snackbar(
    '',
    '',
    backgroundColor: const Color(0xffFF5C5C),
    titleText: Container(),
    borderRadius: 0,
    messageText: Row(
      children: [
        Expanded(
            child: Text(
          message,
          style: const TextStyle(
            fontSize: 12,
            fontFamily: 'Gotham',
            fontWeight: FontWeight.w400,
            color: Colors.white,
          ),
        )),
      ],
    ),
    mainButton: buttonText != null
        ? TextButton(
            onPressed: buttonOnPressed,
            child: Text(buttonText),
          )
        : null,
    duration: const Duration(seconds: 2),
  );
}