hud_overlay 0.1.1 copy "hud_overlay: ^0.1.1" to clipboard
hud_overlay: ^0.1.1 copied to clipboard

A state-management-agnostic, accessibility-first, context-optional Flutter loading overlay. Works in widget trees, BLoC, Riverpod, and service layers with zero boilerplate.

Changelog #

0.1.1 #

  • Fix homepage, repository, and issue_tracker URLs in pubspec.yaml.

0.1.0 #

Initial release.

Core #

  • Context-optional APIHudService shows/dismisses overlays from anywhere (BLoC, Riverpod, service layers) with no BuildContext, while the HudOverlay widget covers any subtree when you prefer a context-aware API.
  • HudScope hosts its own Overlay, so it works regardless of placement.
  • Loading states — indeterminate spinner, deterministic progress, and success / error / info transitions.
  • Helperswrap() shows a spinner for the lifetime of a Future and flips to success/error automatically; trackStream() drives determinate progress from a Stream<double>.
  • Named-key stacking — multiple independent overlays via key, plus dismissAll().
  • Navigation auto-dismiss via HudService.navigatorObserver + HudScope.autoDismissOnNavigation.

Customization #

  • HudTheme controls barrier color, blur (frosted glass), card decoration and padding, indicator, position (top/center/bottom), animation duration and curve, and messageStyle / detailStyle text styling.
  • Theme presetsHudTheme.light() and HudTheme.dark() factory constructors, composable with copyWith.
  • Custom state widgetssuccessWidget, errorWidget, infoWidget.
  • Secondary detail linedetail on HudOverlay, HudService.show, HudOverlayContent, and HudStatus.
  • Cancel buttononCancel + cancelLabel, styled via HudTheme.cancelButtonStyle.

Behavior #

  • Grace periodHudTheme.gracePeriod delays the fade-in so very fast operations never flash; a dismiss during the grace window cancels silently.
  • Minimum show durationHudTheme.minShowDuration prevents flicker by keeping the overlay up for a minimum time once shown.
  • Length-based auto-dismiss — when autoDismiss is omitted for success/error/info, the duration is derived from the message length (floored at 1.5 s, capped at 5 s).
  • Haptic feedbackHudTheme.enableHaptics fires a light impact on success/info and a heavy impact on error.
  • Interactive (non-blocking) modeHudTheme.interactive lets touches pass through to the UI beneath the overlay.

Accessibility #

  • First-class semantics: screen-reader announcements, liveRegion, and a SemanticsRole.progressBar (with value/min/max) for determinate progress.
6
likes
160
points
0
downloads

Documentation

API reference

Publisher

verified publisheruzairaslam.com

Weekly Downloads

A state-management-agnostic, accessibility-first, context-optional Flutter loading overlay. Works in widget trees, BLoC, Riverpod, and service layers with zero boilerplate.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on hud_overlay