Flutter progress button

Overview

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

How to use

Add ProgressButton to your widget tree:

ProgressButton(
    defaultWidget: 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
You might also like...

Flutter Custom, Text, 3D, Social media button's package

Flutter Custom, Text, 3D, Social media button's package

Flutter Button flutter_button, which is a flutter package, contains animated, cool and awesome buttons. That you may like, thanks to this package you

Dec 29, 2022

This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

This flutter package provides an easy implementation of a Slider Button to cancel current transaction or screen

Nov 8, 2022

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

rounded_loading_button RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and

Jan 4, 2023

Simple flutter toggle button widge

Simple flutter toggle button widge

This is simple flutter toggle button widget. Supports show text labels and icons, Possible set multiple value to toggle ui, not only

Sep 27, 2022

A button with ripple effect while being hold

A button with ripple effect while being hold

ripple_button a button with ripple effect while being hold build requirements to run this project you need a working enviroment of flutter v2 or highe

Nov 8, 2021

May be used to intercept the Android back-button, as an alternative to `WillPopScope`.

back_button_interceptor In simple cases, when you need to intercept the Android back-button, you usually add WillPopScope to your widget tree. However

Dec 12, 2022

A custom dropdown button lets the user select from a number of items

A custom dropdown button lets the user select from a number of items

CircularDropDownMenu Description A custom dropdown button lets the user select from a number of items. The button shows the currently selected item as

Dec 5, 2020

A popup simple topModalSheet menu button widget with handsome design and easy to use

A popup simple topModalSheet menu button widget with handsome design and easy to use

top_modal_sheet A popup simple topModalSheet menu button widget with handsome design and easy to use. Installations Add top_modal_sheet: ^1.0.0 in you

Jul 29, 2022

AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect

AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect

async_button_builder AsyncButtonBuilder offers a simple way to extend any type of button with an asynchronous aspect. It allows adding loading, disabl

Jul 10, 2022
Comments
  • Feature request: Provide the

    Feature request: Provide the "elevation" parameter to be able to clear the RaisedButton's elevation

    Hi! thanks for this great package!

    Would you open to provide extra constructor paramater to ProgressButton class? Sometime, the design of the app giving us clean RaisedButton (without elevation / box shadow effect). Providing elevation as another parameter for the ProgressButton class would help a lot.

    I can submit PR if you would like. Thanks for your attention :)

    Regards, Bagus

    opened by contactjavas 1
  • reverse() is called after dispose()

    reverse() is called after dispose()

    If a user navigates away while the button is animating, the widget throws an unhandled exception:

    [VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: 'package:flutter/src/animation/animation_controller.dart': Failed assertion: line 484 pos 7: '_ticker != null': AnimationController.reverse() called after AnimationController.dispose()
    AnimationController methods should not be used after calling dispose.
    #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)
    #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)
    #2      AnimationController.reverse (package:flutter/src/animation/animation_controller.dart:484:7)
    #3      _ProgressButtonState._reverse (package:flutter_progress_button/src/widgets/progress_button.dart:210:21)
    #4      _ProgressButtonState._onButtonPressed.<anonymous closure> (package:flutter_progress_button/src/widgets/progress_button.dart:161:15)
    <asynchronous suspension>
    #5      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
    #6      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink<…>
    
    
    opened by volgin 0
  • Controlling the

    Controlling the "loading" animation via constructor variable

    Hi,

    Nice widget - would be really useful to be able to chose:

    1. Star showing progressWidget onPressed (current behaviour)
    2. Be able to start showing progressWidget via some sort of flag, so can be controled via parent state.

    Something like ProgressButton( showProgress: true/false )

    opened by Drabuna 1
Releases(v0.6.4)
Owner
Yang JIANG
Yang JIANG
Flutter Triple Status Button can use toggle button but in three statuses.

triple_status_button Triple Status Button. Flutter Triple Status Button can use toggle button but in three statuses. Property Description height heigh

MahdiBagjani 2 Nov 13, 2021
Flutter reaction button plugin it is fully customizable widget such as Facebook reaction button

Flutter Reaction Button Flutter button reaction it is fully customizable widget such as Facebook reaction button. Preview Demo Usage Include 'flutter_

Abdelouahed Medjoudja 174 Dec 19, 2022
A button that looks like a Cupertino text button

Cupertino Text Button A button that looks like a Cupertino text button! Text Button A simple text button can be created like this: CupertinoTextButton

Nick Sirovsky 0 Nov 24, 2022
Progress Dialog widget for flutter projects with ability to customize loading widget, background color and background blur.

DISCONTINUED Checkout ArsDialog ars_progress_dialog Customizable progress dialog for Flutter applications with smooth animation for background dim col

Arsam 8 Apr 15, 2022
A Simple and easy to use flutter package for showing progress bar.

progress_dialog A Simple and easy to use flutter package for showing progress bar. #Usage Import the package import 'package:custom_progress_dialog/cu

Vikas Jilla 6 May 23, 2022
Flutter progress dialog. Support both Android and iOS platform.

Flutter Progress Dialog [pub packages] | Flutter progress dialog. Support both Android and iOS platform

Dylan Wu 22 Oct 9, 2022
Customizable Material and Cupertino buttons with progress indicators and more

future_button Customizable Material and Cupertino buttons with progress indicators and more.

Erzhan 33 Oct 13, 2022
Square progress bar

Square progress bar because why not ?? Features Dynamic sizing Animated progress bar Gradient color progress bar Prgreess bar cap shape customization

Yasir Rmaya 5 Dec 2, 2022
A Widget that mimics the Facebook Reaction Button in Flutter.

ReactiveButton A Widget that mimics the Facebook Reaction Button in Flutter. Step by step explanation A full explanation on how to build such Widget m

Didier Boelens 47 Jul 12, 2022
Flutter base, with a navigation button

mysample A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

null 0 Dec 30, 2021