Search packages, repositories and app categories

spring_button cover
Package detailsv2.0.0

spring_button

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
661
Likes
42
Pub points
140

Install package

flutter pub add spring_button

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

SpringButton is a Flutter widget that adds spring-like animations to child widgets when they are pressed or interacted with. It enhances user experience by providing smooth, bouncy feedback on gestures such as taps or drags. The animation is customizable and works across all major platforms including Android, iOS, Web, macOS, Windows, and Linux. Ideal for creating engaging buttons and interactive UI elements with dynamic responses.

Use cases

  • Creating animated buttons with tactile feedback
  • Enhancing touch interactions in mobile apps
  • Adding playful effects to web interfaces
  • Improving user engagement in forms and controls
  • Designing responsive UI components for cross-platform apps

Key features

  • Spring animation on press
  • Customizable animation curves
  • Cross-platform compatibility
  • Simple integration with existing widgets
  • Supports tap and drag gestures

Suitable for

  • Developers seeking interactive UI elements
  • Designers wanting playful button animations
  • Apps focused on user experience
  • Cross-platform Flutter projects
  • Prototyping interactive features

Considerations

  • May impact performance if overused
  • Requires careful tuning of spring parameters
  • Not suitable for minimalistic designs
  • Limited to gesture-based interactions
  • Animation may not be ideal for accessibility-focused apps

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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,
    alignment           : Alignment.center,
    scaleCoefficient    : 0.75,
    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.





Categories

Source repository

Projects using this package