spring_button 1.0.9

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

spring_button #

Cosmos Software

Pub License

A simple widget for having child widgets that respond to gestures with a spring animation.

Media | Description | How-to-Use

Media #

Watch on Youtube:

v1.0.0



Description #

This is a simple widget for having child widgets that respond to gestures with a spring animation.

It is more of an extension to the GestureDetector widget than an original new widget.

How-to-Use #

Simply create a SpringButton as shown in the example:

SpringButton(
    SpringButtonType.OnlyScale, //springButtonType
    uiChild(),                  //uiChild
    {Key key,
    useCache    : true,
    onTapDown,
    onTapUp,
    onTap,
    onTapCancel,
    onSecondaryTapDown,
    onSecondaryTapUp,
    onSecondaryTapCancel,
    onDoubleTap,
    onLongPress,
    onLongPressStart,
    onLongPressMoveUpdate,
    onLongPressUp,
    onLongPressEnd,
    onVerticalDragDown,
    onVerticalDragStart,
    onVerticalDragUpdate,
    onVerticalDragEnd,
    onVerticalDragCancel,
    onHorizontalDragDown,
    onHorizontalDragStart,
    onHorizontalDragUpdate,
    onHorizontalDragEnd,
    onHorizontalDragCancel,
    onForcePressStart,
    onForcePressPeak,
    onForcePressUpdate,
    onForcePressEnd,
    onPanDown,
    onPanStart,
    onPanUpdate,
    onPanEnd,
    onPanCancel,
    onScaleStart,
    onScaleUpdate,
    onScaleEnd})
    
Widget uiChild() {}

Further Explanations:

For a complete set of descriptions for all parameters and methods, see the documentation.

  • SpringButton, as you can see, is very similar to a GestureDetector widget so it should be familiar.

Notes #

I started using and learning Flutter only some weeks ago so this package might have some parts that don't make sense, that should be completely different, that could be much better, etc. Please let me know! Nicely!

Any help, suggestion or criticism is appreciated!

Cheers.





[1.0.9] - 14.10.2019

  • Minor changes.

[1.0.8] - 30.08.2019

  • Minor changes.

  • Improved code style.

  • [1.0.8+1] Updated README.

[1.0.7] - 23.08.2019

  • Minor changes.

[1.0.6] - 23.08.2019

  • A minor bug is fixed.

  • Minor changes.

  • Improved code style with trailing commas.

[1.0.5] - 20.08.2019

  • Improved code style.

  • Updated README.

  • [1.0.5+1] A minor error in the README is fixed.

  • [1.0.5+2] Updated README.

[1.0.4] - 18.08.2019

  • Improved documentation.

[1.0.3] - 17.08.2019

  • Minor changes.

[1.0.2] - 17.08.2019

  • Minor changes.

[1.0.1] - 17.08.2019

  • Minor changes.

[1.0.0] - 17.08.2019

  • Initial release.

example/README.md

example #

Example project for spring_button.

spring_button #

Cosmos Software

Pub License

A simple widget for having child widgets that respond to gestures with a spring animation.

Media | Description | How-to-Use

Media #

Watch on Youtube:

v1.0.0



Description #

This is a simple widget for having child widgets that respond to gestures with a spring animation.

It is more of an extension to the GestureDetector widget than an original new widget.

How-to-Use #

Simply create a SpringButton as shown in the example:

SpringButton(
    SpringButtonType.OnlyScale, //springButtonType
    uiChild(),                  //uiChild
    {Key key,
    useCache    : true,
    onTapDown,
    onTapUp,
    onTap,
    onTapCancel,
    onSecondaryTapDown,
    onSecondaryTapUp,
    onSecondaryTapCancel,
    onDoubleTap,
    onLongPress,
    onLongPressStart,
    onLongPressMoveUpdate,
    onLongPressUp,
    onLongPressEnd,
    onVerticalDragDown,
    onVerticalDragStart,
    onVerticalDragUpdate,
    onVerticalDragEnd,
    onVerticalDragCancel,
    onHorizontalDragDown,
    onHorizontalDragStart,
    onHorizontalDragUpdate,
    onHorizontalDragEnd,
    onHorizontalDragCancel,
    onForcePressStart,
    onForcePressPeak,
    onForcePressUpdate,
    onForcePressEnd,
    onPanDown,
    onPanStart,
    onPanUpdate,
    onPanEnd,
    onPanCancel,
    onScaleStart,
    onScaleUpdate,
    onScaleEnd})
    
Widget uiChild() {}

Further Explanations:

For a complete set of descriptions for all parameters and methods, see the documentation.

  • SpringButton, as you can see, is very similar to a GestureDetector widget so it should be familiar.

Notes #

I started using and learning Flutter only some weeks ago so this package might have some parts that don't make sense, that should be completely different, that could be much better, etc. Please let me know! Nicely!

Any help, suggestion or criticism is appreciated!

Cheers.





Use this package as a library

1. Depend on it

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


dependencies:
  spring_button: ^1.0.9

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:spring_button/spring_button.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
78
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]
89
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/spring_button.dart.

Run flutter format to format lib/spring_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.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test