customToast static method

dynamic customToast({
  1. required dynamic message,
})

Implementation

static customToast({required message}) {
  ScaffoldMessenger.of(Get.context!).showSnackBar(
    SnackBar(
      width: 500,
      elevation: 0,
      behavior: SnackBarBehavior.floating,
      duration: const Duration(seconds: 3),
      backgroundColor: Colors.transparent,
      content: Container(
        padding: const EdgeInsets.all(12.0),
        margin: const EdgeInsets.symmetric(horizontal: 30),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(30),
          color: THelperFunctions.isDarkMode(Get.context!)
              ? TColors().darkerGrey.withValues(alpha: 0.9)
              : TColors().grey.withValues(alpha: 0.9),
        ),
        child: Center(
            child: Text(message,
                style: Theme.of(Get.context!).textTheme.labelLarge)),
      ),
    ),
  );
}