flutter_progress_button 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 91

flutter_progress_button #

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

flutter_progress_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:

flutter_progress_button: '^0.6.4'

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:flutter_progress_button/flutter_progress_button.dart';

How to use #

Add ProgressButton to your widget tree:

ProgressButton(
    normalWidget: const Text('I am a button'),
    progressWidget: const CircularProgressIndicator(),
    width: 196,
    height: 40,
    onPressed: () async {
        int score = await Future.delayed(
            const Duration(milliseconds: 3000), () => 42);
        // After [onPressed], it will trigger animation running backwards, from end to beginning
        return () {
        // Optional returns is returning a VoidCallback that will be called
        // after the animation is stopped at the beginning.
        // A best practice would be to do time-consuming task in [onPressed],
        // and do page navigation in the returned VoidCallback.
        // So that user won't missed out the reverse animation.
        };
    },
),

More parameters:

ProgressButton({
    Key key,
    this.defaultWidget,
    this.progressWidget,
    this.onPressed,
    this.type = ProgressButtonType.Raised,
    this.color,
    this.width = double.infinity,
    this.height = 40.0,
    this.borderRadius = 2.0,
    this.animate = true,
}) : super(key: key);

Three types supported:

enum ProgressButtonType {
    Raised,
    Flat,
    Outline,
}

Source #

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

$ git clone https://github.com/jiangyang5157/flutter_progress_button.git

1.0.0 - 20190616 #

Support Flat and Outline type.

0.6.4 - 20190609 #

README version update.

0.6.3 - 20190609 #

Resolved Bug: Avoid a animate=false scenario that setState is called after dispose.

0.6.2 - 20190608 #

Resolved Bug: Avoid a scenario that dispose is called on a null AnimationController.

0.6.1 - 20190604 #

Improves package health.

0.6.0 - 20190604 #

Support Customized content widgets. Support auto adjusts board radius. Add examples.

0.5.0 - 20190604 #

Implement basic progress button function and animation. Use onProgress call back onPressed and returns a result handler function to indicate animation is completed and you are ready to go.

example/README.md

example #

Demonstrates how to use the flutter_progress_button.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_progress_button: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_progress_button/flutter_progress_button.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Nov 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/widgets/progress_button.dart. (-0.50 points)

Analysis of lib/src/widgets/progress_button.dart reported 1 hint:

line 92 col 3: This function has a return type of 'Widget', but doesn't end with a return statement.

Maintenance suggestions

The description is too long. (-6 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test