material_async_button library
Drop-in async wrappers for Flutter Material buttons.
See ElevatedAsyncButton, FilledAsyncButton, OutlinedAsyncButton,
TextAsyncButton, IconAsyncButton, and FloatingActionAsyncButton for
the named-constructor variants. Use AsyncButton when you need a custom
non-Material button.
Classes
- AsyncButton
- Low-level async-loading shell for arbitrary buttons.
- AsyncButtonController
-
A read-only ValueListenable of an AsyncButton's loading state (
truewhileonPressedis in flight), plus imperative trigger / reset. - AsyncButtonSpinner
-
The default loading indicator — a sized, indeterminate
CircularProgressIndicator. Used as the fallback loading view, and exposed so you can tweak it and return it from aloadingBuilder: - AsyncButtonTheme
-
App-wide defaults for
material_async_buttonwidgets, attached as aThemeExtensiononThemeData. ComplementsButtonStyle/ButtonThemeData— it carries only async behaviour (the loading view, its transition, its footprint, minimum duration and whether loading disables the button), never styling knobs. - AsyncMaterialButton
- Sealed base for the Material wrapper widgets shipped with this package (ElevatedAsyncButton, FilledAsyncButton, OutlinedAsyncButton, TextAsyncButton, IconAsyncButton, FloatingActionAsyncButton).
- AsyncStandardMaterialButton
-
Sub-base for the four AsyncMaterialButtons that share the standard
ButtonStyleButtonsurface (ElevatedAsyncButton, FilledAsyncButton, OutlinedAsyncButton, TextAsyncButton). Centralises the common Material parameters and the.iconconstructor pieces so each concrete subclass only has to render its specific button widget via_buildButton/_buildIconButton. - ElevatedAsyncButton
-
Async-aware
ElevatedButton. WhileonPressedis running the label is swapped for the loading widget. - FilledAsyncButton
-
Async-aware
FilledButtonwith all four Material 3 flavors: FilledAsyncButton.new, FilledAsyncButton.tonal, FilledAsyncButton.icon, FilledAsyncButton.tonalIcon. - FloatingActionAsyncButton
-
Async-aware
FloatingActionButton. WhileonPressedis running the child (or label, for.extended) is swapped for the loading widget. - IconAsyncButton
-
Async-aware
IconButton. Includes all four Material 3 flavors: IconAsyncButton.new, IconAsyncButton.filled, IconAsyncButton.filledTonal, IconAsyncButton.outlined. - OutlinedAsyncButton
-
Async-aware
OutlinedButton. - TextAsyncButton
-
Async-aware
TextButton.
Typedefs
- AsyncButtonTransitionBuilder = Widget Function(BuildContext context, Widget child, bool isLoading)
- Signature for AsyncButton.transitionBuilder.
- AsyncButtonWidgetBuilder = Widget Function(BuildContext context, Widget child, AsyncCallback? callback, bool isLoading)
- Signature for AsyncButton.builder.