easy_loading_button 0.1.0 copy "easy_loading_button: ^0.1.0" to clipboard
easy_loading_button: ^0.1.0 copied to clipboard

outdated

A simple & easy to use flutter progress / loading button.

easy_loading_button #

GitHub repo size GitHub code size in bytes GitHub top language GitHub issues GitHub license

easy_loading_button is a free and open source (MIT license) Material Flutter Button that supports variety of buttons style demands. It is designed to be easy to use and customizable.

Get started #

Depend on it #

Add this to your package's pubspec.yaml file:

easy_loading_button: '^0.1.0'

Install it #

You can install packages from the command line:

$ flutter pub get

Alternatively, your editor might support flutter pub get.

Import it #

Now in your Dart code, you can use:

import 'package:easy_loading_button/easy_loading_button.dart';

How to use #

Add EasyButton to your widget tree:

EasyButton(
  type: EasyButtonType.elevated,
  idleStateWidget: const Text(
    'Elevated Button',
    style: TextStyle(
      color: Colors.white,
    ),
  ),
  loadingStateWidget: const CircularProgressIndicator(
    strokeWidth: 3.0,
    valueColor: AlwaysStoppedAnimation<Color>(
      Colors.white,
    ),
  ),
  // Whether to animate the button width or not.
  useWidthAnimation: false,
  // When useWidthAnimation is set to false, you might want to set the  parameter to true.
  useEqualLoadingStateWidgetDimension: true,
  // If you want a fullwidth size, set this to double.infinity
  width: 150.0,
  height: 40.0,
  borderRadius: 4.0,
  // The gap between button and it's content. This will be ignored when the type is 
  contentGap: 6.0,
  buttonColor: Colors.blueAccent,
  onPressed: () {},
),

More parameters:

const EasyButton({
  Key? key,
  required this.idleStateWidget,
  required this.loadingStateWidget,
  this.type = EasyButtonType.elevated,
  this.useWidthAnimation = true,
  this.useEqualLoadingStateWidgetDimension = true,
  this.width = double.infinity,
  this.height = 40.0,
  this.contentGap = 0.0,
  this.borderRadius = 0.0,
  this.buttonColor = Colors.blueAccent,
  this.onPressed,
}) : super(key: key);

Three types supported:

enum EasyButtonType {
    elevated,
    outlined,
    text,
}

Source #

Source code and example of this library can be found in git:

$ git clone https://github.com/usefulteam/easy_loading_button.git

License #

MIT License

Credits #

Thanks to x for the flutter_progress_button package. My package was based on it.

44
likes
0
pub points
91%
popularity

Publisher

verified publisherusefulteam.com

A simple & easy to use flutter progress / loading button.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on easy_loading_button