Skip to content
pubscout

multi_state_button

1.1.3, released 5 years ago by an unverified publisher

A Flutter button widget that supports multiple customizable states and animated transitions.

WASM-ready
$ flutter pub add multi_state_button
Source repository

What it does

Provides a MultiStateButton and SingleStateButton allowing developers to define different states (such as submit, loading, and success) with custom sizes, colors, decorations, and child widgets. It includes a controller to easily transition between states with built-in animations.

AI-written summary of version 1.1.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a submit button that transitions between loading, success, and error states.
  • You want custom animations and sizes for different button states.

Skip it when

  • You only need a standard static Material button.
  • You require complex state management solutions beyond simple button state transitions.

Strengths

  • Endless customizability for each state including size, color, and decoration.
  • Smooth animated transitions between button states.
  • Simple controller API to switch states.

Weaknesses

  • Limited to button state management only.
  • No pre-packaged theme integrations mentioned beyond basic Flutter properties.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:multi_state_button/multi_state_button.dart';

final MultiStateButtonController controller = MultiStateButtonController(initialStateName: 'Submit');

MultiStateButton(
  multiStateButtonController: controller,
  buttonStates: [
    ButtonState(
      stateName: 'Submit',
      child: Text('Submit'),
      onPressed: () => controller.setButtonState = 'Loading',
    ),
    ButtonState(
      stateName: 'Loading',
      child: CircularProgressIndicator(),
      onPressed: () => controller.setButtonState = 'Submit',
    ),
  ],
);

Alternatives

Packages that do the same job and could replace multi_state_button.