Giter Site home page Giter Site logo

domesticmouse / bounce_tap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethiel97/bounce_tap

0.0 2.0 0.0 3.84 MB

A great and efficacious flutter package for an **on-tap bounce** animation on any flutter widget

License: MIT License

Objective-C 0.66% Kotlin 2.17% Dart 90.11% Swift 7.06%

bounce_tap's Introduction

  • A great flutter and efficacious package for an on-tap bounce animation on any flutter widget

Usage

To use this package, add bounce_tap as a dependency in your pubspec.yaml file.

Demo

Example

  • Import the library
import 'package:bounce_tap/bounce_tap.dart';
  • In order to use this package, we just need to wrap the content with the widget BounceTap.
  • Only child,onTap are mandatory in the widget.
  • tapIntensity is used to define how much the widget should scale down when pressed
  • Stronger is tapIntensity, stronger will the widget bounce.
  • tapIntensity,onTap and duration can have null in the widget. By default duration is set to 200 ms.
BounceTap(
  duration: Duration(milliseconds: 150),
  onPressed: (){ YOUR_FUNCTION },
  child: YOUR_WIDGET,
  tapIntensity: TapIntensity.mid
)

Documentation

BounceTap properties

Name Type Default Description
child Widget required child widget
onTap VoidCallback required onTap event handler
tapIntensity TapIntensity TapIntensity.mid sets the intensity of the tap, if defines how hard you want the widget to bounce on tap
duration Duration Duration(milliseconds:250) sets the duration of the bounce animation
onLongPressed VoidCallback null onLongPress event handler
tapDelay int 300 how long the widget should wait before calling the onTap/onLongPress events handlers

Now enjoy!

Refer to example folder and the source code for more information.

Acknowledgement

  • I would like to thank Mohsin for the inspiration for this library, which I think will be useful for Flutter community

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.