show static method

void show(
  1. String message, {
  2. Duration duration = const Duration(seconds: 2),
  3. IconData? icon,
  4. Color? iconColor,
  5. bool isError = false,
})

Implementation

static void show(
    String message, {
      Duration duration = const Duration(seconds: 2),
      IconData? icon,
      Color? iconColor,
      bool isError = false
    }) {
  final overlay = Get.key.currentState?.overlay;
  if (overlay == null) return;

  late OverlayEntry entry;

  entry = OverlayEntry(
    builder: (_) => WindowsToast(message: message, icon: icon,
      iconColor: iconColor, isError: isError, duration: duration,
      onDismissed: () => entry.remove()
    ),
  );

  overlay.insert(entry);
}