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.
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.
- flutter_expandable_fab
Speed dial floating action button widget that animates multiple action buttons.
82Compare - loading_icon_button
Flutter loading buttons with state machine, success/error states and animated thinking-orbs.
69Compare - any_animated_button
An expandable button that animates between idle, progress, success, and error states using BLoC.
49Compare - slideable
Flexible and customizable slideable list item widget for Flutter apps.
62Compare