SmartDialogManager class

A singleton manager for displaying global dialogs and loading indicators in Flutter.

This class provides a unified way to show:

  • Confirmation dialogs with customizable appearance and actions
  • Loading indicators with optional animation customization
  • Custom widgets as modal dialogs

Key Features:

  • Show dialogs from anywhere without requiring BuildContext
  • Auto-dismiss functionality with customizable duration
  • Global status callbacks for dialog lifecycle tracking
  • Support for default styling through initialization parameters
Mixed-in types

Constructors

SmartDialogManager.new()
Factory constructor to get the singleton instance
factory

Properties

currentWidget Widget?
Gets the currently displayed widget (dialog or loading indicator)
no setter
hashCode int
The hash code for this object.
no setterinherited
overlayEntry SmartDialogOverlayEntry?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addStatusCallback(SmartDialogStatusCallback callback) → void
inherited
callback(SmartDialogStatusEnum status) → void
inherited
cancelTimer() → void
inherited
initializeOverlayEntry(SmartDialogOverlayEntry entry) → void
inherited
markNeedsBuild() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAllCallbacks() → void
inherited
removeCallback(SmartDialogStatusCallback callback) → void
inherited
startTimer(Duration duration, dynamic onTimeout()) → void
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance SmartDialogManager
Gets the singleton instance
no setter
isShowing bool
Checks if a dialog or loading indicator is currently displayed
no setter

Static Methods

dismiss() Future<void>
Dismisses the currently displayed dialog or loading indicator
init({TransitionBuilder? builder, Duration? displayDuration, SmartDialogParams? smartDialogParams, SmartLoadingParams? smartLoadingParams}) TransitionBuilder
Initializes the dialog manager with global configuration
showCustomDialog({required Widget customWidget, Duration? duration}) Future<void>
Displays a custom widget as a modal dialog
showDialog({Duration? duration, SmartDialogParams? params, bool isClosable = true}) Future<void>
Displays a confirmation dialog with customizable content and actions
showLoading({Duration? duration, SmartLoadingParams? params}) Future<void>
Displays a loading indicator