loading_icon_button 1.1.0 copy "loading_icon_button: ^1.1.0" to clipboard
loading_icon_button: ^1.1.0 copied to clipboard

Flutter loading buttons with built-in idle, loading, success and error states, plus animated thinking-orb indicators for AI and agent interfaces.

Changelog #

All notable changes to this project are documented in this file. The format is based on Keep a Changelog and this project adheres to semantic versioning.

1.1.0 #

Requires Dart >=3.4.0 / Flutter >=3.22.0. See the Migration Guide — nothing else in this release is required, and no public member was removed.

Added #

  • ThinkingOrb, a family of animated indicators for AI and agent interfaces, with nine OrbState animations (working, searching, solving, listening, connecting, weaving, composing, breathing, shaping), two size tiers, a shared clock, TickerMode awareness and a static frame under reduced motion. Exported alongside OrbTheme and kOrbSemanticLabels.
  • LoadingIndicator, a sealed type with .circular(), .orb(), .widget() and .builder() constructors, plus LoadingProgressStyle (indicator, fill, both). Accepted by LoadingButton.indicator and by a new indicator argument on every Material loading button.
  • LoadingButtonController and LoadingButtonValue for driving a button from outside the widget tree: start, setProgress, success, error, reset, setEnabled, setActionState, press and startCooldown.
  • LoadingButtonSizing: legacy (the default, unchanged 200x50 geometry), .intrinsic({constraints}), .expand({height}) and .fixed({width, height}).
  • LoadingButtonColors with .fromScheme(), .traffic() and .legacy, and LoadingButtonColorStrategy (legacy by default, or material3 to derive every state colour from the ambient ColorScheme).
  • LoadingButtonThemeData, a ThemeExtension, and the LoadingButtonTheme inherited widget, for per-subtree and per-brightness defaults.
  • LoadingButton arguments: buttonStyle, sizing, controller, indicator, progress, progressStyle, colors, colorStrategy, enabled, debounce, cooldown, focusNode, autofocus, tooltip, transitionBuilder, onSuccess and onFailure(Object, StackTrace).
  • LoadingButtonState is now public, exposing press() and currentState for use through a GlobalKey.
  • Matching LoadingButtonBuilder methods for all of the above.
  • llms.txt, a compact machine-readable API digest for AI coding assistants, together with a README section of copy-pasteable prompts. Assistants trained on the 0.0.x API confidently emit parameters that were removed in 1.0.0 (iconData, successIcon, showBox, loaderSize, animateOnTap) and the pre-1.0.2 ButtonState; the digest lists each one with its replacement.

Changed #

  • The declared SDK floor is now Dart >=3.4.0 / Flutter >=3.22.0. This is a correction, not a drop in support: the package has used WidgetStatesController (Flutter 3.22+) since 1.0.0, so the previously declared flutter: ">=1.17.0" had been fiction for several releases. Older SDKs got a confusing compile error inside the package instead of a clean pub resolution message; they now get the resolution message.
  • LoadingButton no longer uses rxdart internally; state is a plain ValueNotifier.
  • The default loading, success and error widgets no longer hard-code Colors.white; they inherit the button's resolved foreground colour, which every Material button publishes through IconTheme. The rendering is identical under LoadingButtonColorStrategy.legacy (whose foreground is white anyway) and fixes an invisible white-on-light-container icon under material3 and on outlined and text buttons.
  • The README screenshots are now real renders of the real widgets, generated by tool/generate_screenshots.dart and packed by tool/pack_animations.sh. The previous generated-image.png was a 2.5 MB promotional graphic rather than a screenshot, and the code in it (LoadingButton(icon:, onTap:), an AutoLoadingButton class) matched no release of this package. It has been removed; the published archive dropped from 2 MB to 879 KB.
  • onPressed now runs immediately on tap. It used to wait for an awaited haptic round trip and a ~200 ms scale animation first.
  • Haptic feedback is fired and forgotten rather than awaited, which also stops widget tests of a press from hanging on a test binding.
  • onStateChanged is called only for real state changes; it no longer fires a spurious ActionState.idle when the button is first built.
  • Screen readers announce a LoadingButton once: the duplicate Semantics(button: true) wrapper is gone, and transient state text is announced through a liveRegion label on the child instead.
  • ActionState.disabled is now reachable, via the enabled argument or a controller.
  • ButtonStateExtension is renamed ActionStateExtension, finishing the 1.0.2 rename. Member access (state.isLoading and friends) is unaffected, since extension members resolve by member name, not by extension name; only explicit extension overrides need updating.
  • ActionStateExtension.isInteractive now means "a press would be accepted" (!loading && !disabled) instead of being an exact duplicate of isIdle. Use isIdle for the old meaning.
  • ArgonTimerButton.loader is now typed Widget Function(int time)?, up from Function(int time)?. This is a source-breaking narrowing: a closure whose inferred return type was dynamic (for example one with a non-Widget branch, or an untyped => body the analyzer resolved to dynamic) no longer assigns. Annotate the closure's return type as Widget — the value was always used in a child: position, so no runtime behaviour changes.
  • ArgonButton with a null loader now shows a default spinner while busy. It previously rendered nothing at all: loader was passed straight into a child: position, where null is legal, so the button animated down to a pill and sat there empty. If you relied on the empty pill, pass loader: const SizedBox.shrink().

Fixed #

  • A throwing callback on an *AutoLoadingButton no longer leaves the button a dead spinner. doPress and doLongPress share one implementation that clears the loading flag on both the success and the failure path; tap-path errors are reported via FlutterError.reportError, and callers that await doPress() receive the error instead.
  • A fast double tap can no longer run LoadingButton.onPressed twice; the press path is latched synchronously before the first await.
  • The success/error reset is a cancellable Timer instead of an uncancellable Future.delayed, so a disposed button no longer fires a stale reset.
  • LoadingButton reads MediaQuery.sizeOf, so it no longer rebuilds on every unrelated MediaQuery change.
  • ArgonButton no longer force-unwraps its nullable onTap; a null onTap renders the button disabled instead of throwing on the first tap. The escaping startLoading/stopLoading closures and the animation callbacks are mounted-guarded.
  • ArgonTimerButton no longer force-unwraps its nullable loader, which threw as soon as the countdown started when no loader was given.
  • ArgonTimerButton.startTimer throws an ArgumentError instead of a bare String.
  • buildChildWithIC no longer pushes its label off the end of the row when the icon is null, and its gap no longer adds vertical padding.

Deprecated #

All of these keep working until 2.0.0.

  • LoadingButton.onError and LoadingButtonBuilder.onError — use onFailure, which also receives the StackTrace.
  • LoadingButtonConfig — use LoadingButtonThemeData with LoadingButtonTheme, or as a ThemeExtension on ThemeData. It is still read as the last fallback, so existing code is unaffected.
  • The top-level helpers in icon_button.dartIconButtonLoading, buildChildWithIcon, buildChildWithIC and buildText. Compose a Row or a Text yourself.

1.0.3 #

Fixed #

  • A widget disposed while onPressed was still running no longer throws; the success and error transitions are mounted-guarded (#8).

1.0.2 #

Changed #

  • Breaking: ButtonState is renamed ActionState, with no deprecated alias. Replace ButtonState with ActionState (leave ArgonButtonState and LoadingButtonState alone).

1.0.1 #

  • URLs updated.

1.0.0 #

  • Full refactor of the package.
  • Added new material buttons.
  • See the Migration Guide for details.

0.0.7 #

  • Dependencies updated.

0.0.6 #

  • Dependencies updated.

0.0.5 #

  • Readme updated.

0.0.4 #

0.0.3 #

  • Example application android bug fixed.
  • Text alignment fixed.

0.0.2 #

  • Readme updated.

0.0.1 #

  • Initial release.
40
likes
160
points
412
downloads
screenshot

Documentation

Documentation
API reference

Publisher

verified publishermohesu.com

Weekly Downloads

Flutter loading buttons with built-in idle, loading, success and error states, plus animated thinking-orb indicators for AI and agent interfaces.

Homepage
Repository (GitHub)
View/report issues

Topics

#button #loading #animation #ui #material-design

License

MIT (license)

Dependencies

flutter

More

Packages that depend on loading_icon_button