SmartStateOverlayConfig class
Configuration class for overlay state customization
Provides comprehensive control over overlay behavior and appearance for loading, error, success, and other states when displayed as overlays.
Example:
SmartStateOverlayConfig(
enabledStates: [SmartState.loading, SmartState.error],
isDismissible: true,
barrierColor: Colors.black54,
loadingConfig: OverlayStateConfig(
backgroundColor: Colors.white,
borderRadius: BorderRadius.circular(12),
),
)
- Annotations
Constructors
-
SmartStateOverlayConfig({List<
SmartState> enabledStates = const [SmartState.loading, SmartState.error, SmartState.success], bool isDismissible = false, bool barrierDismissible = false, Color? barrierColor, Alignment alignment = Alignment.center, OverlayStateConfig loadingConfig = const OverlayStateConfig(), OverlayStateConfig errorConfig = const OverlayStateConfig(backgroundColor: Colors.white, iconColor: Colors.red, textColor: Colors.black87), OverlayStateConfig successConfig = const OverlayStateConfig(backgroundColor: Colors.white, iconColor: Colors.green, textColor: Colors.black87), OverlayStateConfig emptyConfig = const OverlayStateConfig(), OverlayStateConfig offlineConfig = const OverlayStateConfig(backgroundColor: Colors.white, iconColor: Colors.orange, textColor: Colors.black87)}) -
const
Properties
- alignment → Alignment
-
Alignment of overlay content on screen
final
- barrierColor → Color?
-
Color of the barrier/backdrop behind the overlay
Default: Colors.black.withOpacity(0.5)
final
- barrierDismissible → bool
-
Whether tapping the barrier dismisses the overlay (for dialog-style overlays)
final
- emptyConfig → OverlayStateConfig
-
Configuration for empty overlay
final
-
enabledStates
→ List<
SmartState> -
Which states should be shown as overlays
Default:
SmartState.loading, SmartState.error, SmartState.successfinal - errorConfig → OverlayStateConfig
-
Configuration for error overlay
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDismissible → bool
-
Whether the overlay can be dismissed by tapping outside
Note: This works in combination with onDismiss callback
final
- loadingConfig → OverlayStateConfig
-
Configuration for loading overlay
final
- offlineConfig → OverlayStateConfig
-
Configuration for offline overlay
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- successConfig → OverlayStateConfig
-
Configuration for success overlay
final
Methods
-
getConfigForState(
SmartState state) → OverlayStateConfig - Get configuration for specific state
-
isOverlayEnabledForState(
SmartState state) → bool - Helper method to check if a state should be shown as overlay
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited