import 'package:flutter/cupertino.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; class ToastUtil { ToastUtil._(); static int lengthShort = 2000; static int lengthLong = 3500; static void show(String? msg, {Duration? displayTime, SmartToastType? displayType = SmartToastType.normal, bool? addPostFrame}) { if (msg != null) { if (addPostFrame == true) { WidgetsBinding.instance.addPostFrameCallback((_) { SmartDialog.showToast(msg, displayType: displayType, displayTime: displayTime); }); } else { SmartDialog.showToast(msg, displayType: displayType, displayTime: displayTime); } } } }