showToast static method

dynamic showToast(
  1. ToastType type,
  2. String msg,
  3. BuildContext context
)

Implementation

static showToast(ToastType type, String msg, BuildContext context) {
  init(context);
  fToast!.showToast(
      child: Container(
        padding: const EdgeInsets.symmetric(horizontal: 48.0, vertical: 24.0),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(12.0),
          color: const Color(0xFF333333),
        ),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Padding(
                padding: const EdgeInsets.fromLTRB(0, 12.0, 0, 36.0),
                child: Icon(generateIcon(type),
                    size: 64.0, color: Colors.white)),
            Text(
              msg,
              style: const TextStyle(
                color: Colors.white,
                fontSize: 18,
              ),
            ),
          ],
        ),
      ),
      gravity: ToastGravity.CENTER,
      toastDuration: const Duration(seconds: 2));
}