loading_icon_button 1.1.0
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 nineOrbStateanimations (working,searching,solving,listening,connecting,weaving,composing,breathing,shaping), two size tiers, a shared clock,TickerModeawareness and a static frame under reduced motion. Exported alongsideOrbThemeandkOrbSemanticLabels.LoadingIndicator, a sealed type with.circular(),.orb(),.widget()and.builder()constructors, plusLoadingProgressStyle(indicator,fill,both). Accepted byLoadingButton.indicatorand by a newindicatorargument on every Material loading button.LoadingButtonControllerandLoadingButtonValuefor driving a button from outside the widget tree:start,setProgress,success,error,reset,setEnabled,setActionState,pressandstartCooldown.LoadingButtonSizing:legacy(the default, unchanged 200x50 geometry),.intrinsic({constraints}),.expand({height})and.fixed({width, height}).LoadingButtonColorswith.fromScheme(),.traffic()and.legacy, andLoadingButtonColorStrategy(legacyby default, ormaterial3to derive every state colour from the ambientColorScheme).LoadingButtonThemeData, aThemeExtension, and theLoadingButtonThemeinherited widget, for per-subtree and per-brightness defaults.LoadingButtonarguments:buttonStyle,sizing,controller,indicator,progress,progressStyle,colors,colorStrategy,enabled,debounce,cooldown,focusNode,autofocus,tooltip,transitionBuilder,onSuccessandonFailure(Object, StackTrace).LoadingButtonStateis now public, exposingpress()andcurrentStatefor use through aGlobalKey.- Matching
LoadingButtonBuildermethods 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.2ButtonState; 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 declaredflutter: ">=1.17.0"had been fiction for several releases. Older SDKs got a confusing compile error inside the package instead of a cleanpubresolution message; they now get the resolution message. LoadingButtonno longer usesrxdartinternally; state is a plainValueNotifier.- 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 throughIconTheme. The rendering is identical underLoadingButtonColorStrategy.legacy(whose foreground is white anyway) and fixes an invisible white-on-light-container icon undermaterial3and on outlined and text buttons. - The README screenshots are now real renders of the real widgets, generated by
tool/generate_screenshots.dartand packed bytool/pack_animations.sh. The previousgenerated-image.pngwas a 2.5 MB promotional graphic rather than a screenshot, and the code in it (LoadingButton(icon:, onTap:), anAutoLoadingButtonclass) matched no release of this package. It has been removed; the published archive dropped from 2 MB to 879 KB. onPressednow 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.
onStateChangedis called only for real state changes; it no longer fires a spuriousActionState.idlewhen the button is first built.- Screen readers announce a
LoadingButtononce: the duplicateSemantics(button: true)wrapper is gone, and transient state text is announced through aliveRegionlabel on the child instead. ActionState.disabledis now reachable, via theenabledargument or a controller.ButtonStateExtensionis renamedActionStateExtension, finishing the 1.0.2 rename. Member access (state.isLoadingand friends) is unaffected, since extension members resolve by member name, not by extension name; only explicit extension overrides need updating.ActionStateExtension.isInteractivenow means "a press would be accepted" (!loading && !disabled) instead of being an exact duplicate ofisIdle. UseisIdlefor the old meaning.ArgonTimerButton.loaderis now typedWidget Function(int time)?, up fromFunction(int time)?. This is a source-breaking narrowing: a closure whose inferred return type wasdynamic(for example one with a non-Widgetbranch, or an untyped=>body the analyzer resolved todynamic) no longer assigns. Annotate the closure's return type asWidget— the value was always used in achild:position, so no runtime behaviour changes.ArgonButtonwith a nullloadernow shows a default spinner while busy. It previously rendered nothing at all:loaderwas passed straight into achild:position, where null is legal, so the button animated down to a pill and sat there empty. If you relied on the empty pill, passloader: const SizedBox.shrink().
Fixed #
- A throwing callback on an
*AutoLoadingButtonno longer leaves the button a dead spinner.doPressanddoLongPressshare one implementation that clears the loading flag on both the success and the failure path; tap-path errors are reported viaFlutterError.reportError, and callers that awaitdoPress()receive the error instead. - A fast double tap can no longer run
LoadingButton.onPressedtwice; the press path is latched synchronously before the firstawait. - The success/error reset is a cancellable
Timerinstead of an uncancellableFuture.delayed, so a disposed button no longer fires a stale reset. LoadingButtonreadsMediaQuery.sizeOf, so it no longer rebuilds on every unrelatedMediaQuerychange.ArgonButtonno longer force-unwraps its nullableonTap; a nullonTaprenders the button disabled instead of throwing on the first tap. The escapingstartLoading/stopLoadingclosures and the animation callbacks aremounted-guarded.ArgonTimerButtonno longer force-unwraps its nullableloader, which threw as soon as the countdown started when noloaderwas given.ArgonTimerButton.startTimerthrows anArgumentErrorinstead of a bareString.buildChildWithICno 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.onErrorandLoadingButtonBuilder.onError— useonFailure, which also receives theStackTrace.LoadingButtonConfig— useLoadingButtonThemeDatawithLoadingButtonTheme, or as aThemeExtensiononThemeData. It is still read as the last fallback, so existing code is unaffected.- The top-level helpers in
icon_button.dart—IconButtonLoading,buildChildWithIcon,buildChildWithICandbuildText. Compose aRowor aTextyourself.
1.0.3 #
1.0.2 #
Changed #
- Breaking:
ButtonStateis renamedActionState, with no deprecated alias. ReplaceButtonStatewithActionState(leaveArgonButtonStateandLoadingButtonStatealone).
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 #
- New Argon buttons added, inspired by argon_buttons_flutter.
- Dependencies updated.
0.0.3 #
- Example application android bug fixed.
- Text alignment fixed.
0.0.2 #
- Readme updated.
0.0.1 #
- Initial release.