load_in_button 0.0.2

Flutter Android iOS

A button with a load inside.

load_in_button #

A button with a loading icon inside.

Getting Started #

Just create the button on your code as the same way you would with a FlatButton.

LoadInButton(
  key: _buttonKey,
  onPressed: _buttonPressed,
  child: Text('CONFIRMAR PEDIDO'),
  color: Colors.red,
  textColor: Colors.white
)

Control the loading #

bool variable

LoadInButton contains a isLoading property which controls if the button is loading or not. Just set it's value on the widget build.

LoadInButton(
  key: _buttonKey,
  isLoading: _isButtonLoading,
  onPressed: _buttonPressed,
  child: Text('CONFIRMAR PEDIDO'),
  color: Colors.red,
  textColor: Colors.white
)
Acessing the state

It's also possible to use the GlobalKey to retrieve the start and use the helper methods

//Start the loading
_buttonKey.currentState?.start();

//Do something

//Finish the loading
_buttonKey.currentState?.finish();
0
likes
60
pub points
65%
popularity

Publisher

neomode.com.br

A button with a load inside.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on load_in_button