circular_loading_button 1.0.4 copy "circular_loading_button: ^1.0.4" to clipboard
circular_loading_button: ^1.0.4 copied to clipboard

circular_loading_button is simple Flutter loading/progress animated button.

loading_button #

loading_button is a flutter loading/progress animated button.

loading_button is implemented using native flutter buttons type (ElevatedButton, FilledButton, OutlinedButton at this moment). For this reason it is customizable throught your app theme

Try at demo on DartPad

Getting Started #

Follow these steps to use this package

Add dependency #

dependencies:
  circular_loading_button: ^1.0.0

Add import package #

import 'package:circular_loading_button/loading_button.dart';

Easy to use #

Simple example of use LoadingButton
Put this code in your project at an screen and learn how it works 😊

// set initial button state
LoadingButtonState _currentState = LoadingButtonState.idle;

LoadingButton(
  type: LoadingButtonType.elevated,
  state: _currentState,
  onPressed: () {
    // change button state to loading
    setState(() => _currentState = LoadingButtonState.loading);
    
    // wait 3 seconds and set button state to idle
    Future.delayed(const Duration(seconds: 3), () => setState(() => _currentState = LoadingButtonState.idle));
    },
  child: const Text('Tap me!')
)

Parameters #

You can define button sizes in loading and idle state simply adding 'expandedSize' and 'loadingSize' parameters.

LoadingButton(
    type: LoadingButtonType.elevated,
    state: _currentState,
    expandedSize: const Size(250.0, 80.0),
    loadingSize: const Size(30.0, 30.0),
    onPressed: () {
      // TODO your actions
    },
    child: const Text('Tap me!')
)

Contributions #

All contributions are welcome! Contributions are what make the open source community such an amazing place to be learned, inspire, and create. Any contributions you make are greatly appreciated.

6
likes
160
points
27
downloads

Publisher

verified publisherdevthis.it

Weekly Downloads

circular_loading_button is simple Flutter loading/progress animated button.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on circular_loading_button