Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.3 KB

README.md

File metadata and controls

96 lines (71 loc) · 2.3 KB

progress_loading_button

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

progress_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

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

progress_loading_button: '^1.0.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:progress_loading_button/progress_loading_button.dart';

How to use

Add LoadingButton to your widget tree:

LoadingButton(
    defaultWidget: Text('Click Me'),
    width: 196,
    height: 60,
    onPressed: () async {
        await Future.delayed(
            Duration(milliseconds: 3000),
            () {
                print('Button Pressed');
            },
        );
    },
)

More parameters:

LoadingButton({
    Key? key,
    required this.defaultWidget,
    this.loadingWidget = const CircularProgressIndicator(),
    required this.onPressed,
    this.type = LoadingButtonType.Raised,
    this.color,
    this.width = double.infinity,
    this.height = 40.0,
    this.borderRadius = 5.0,
    this.borderSide = BorderSide.none,
    this.animate = true,
  }) : super(key: key);

Three types supported:

enum LoadingButtonType {
  Raised,
  Flat,
  Outline,
}

Example

Source

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

$ git clone https://github.com/gairick-saha/progress_loading_button.git