rounded_loading_button 1.0.4

rounded_loading_button #

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

Installation #

Add this to your pubspec.yaml:

dependencies:
    rounded_loading_button: ^1.0.0

Usage #

Import #

import 'package:rounded_loading_button/rounded_loading_button.dart';

Simple Implementation #

final RoundedLoadingButtonController _btnController = new RoundedLoadingButtonController();

void _doSomething() async {
    Timer(Duration(seconds: 3), () {
        _btnController.success();
    });
}

RoundedLoadingButton(
    child: Text('Tap me!', style: TextStyle(color: Colors.white)),
    controller: _btnController,
    onPressed: _doSomething,
)

[1.0.4]

  • Added animation disposal
  • Added configurable width
  • Added configurable animation on tapped

[1.0.3]

  • Example test updates

[1.0.2]

  • Example updates

[1.0.1]

  • Format changes
  • Description update

[1.0.0]

  • Initial release.

example/README.md

example_app #

class _MyHomePageState extends State<MyHomePage> {

final RoundedLoadingButtonController _btnController = new RoundedLoadingButtonController();

void _doSomething() async {
    Timer(Duration(seconds: 3), () {
    _btnController.success();
    });
}

@override
Widget build(BuildContext context) {

    return Scaffold(
    appBar: AppBar(

        title: Text(widget.title),
    ),
    body: Center(
        child: Column(

        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
            RoundedLoadingButton(
            child: Text('Tap me!', style: TextStyle(color: Colors.white)),
            controller: _btnController,
            onPressed: _doSomething,
            )
        ],
        ),
    )
    );
}
}

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  rounded_loading_button: ^1.0.4

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:rounded_loading_button/rounded_loading_button.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
88
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health suggestions

Format lib/rounded_loading_button.dart.

Run flutter format to format lib/rounded_loading_button.dart.

Dependencies

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