IndicatorService class

A service class to display and manage a custom indicator using a SnackBar.

This service allows showing a persistent indicator, such as a loading spinner or an animation with a logo, typically used to indicate ongoing processes like network requests. It leverages a GlobalKey<ScaffoldMessengerState> to display the indicator as a SnackBar at the bottom of the screen.

An indicator widget or a logo image must be provided during initialization. If both are provided, the custom indicatorWidget takes precedence.

Constructors

IndicatorService({required BuildContext context, required GlobalKey<ScaffoldMessengerState> smKey, Widget? indicatorWidget, ImageProvider<Object>? logoImage})
Creates an IndicatorService.

Properties

hashCode int
The hash code for this object.
no setterinherited
isActive bool
Checks if the indicator is currently active (visible).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

hide() → void
Hides the currently active indicator.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
show() → void
Displays the indicator.
toString() String
A string representation of this object.
inherited

Operators

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