FLUTTER ECOSYSTEM

fedeamura/flutter_scale_tap

Scale/Opacity animated button

flutter_scale_tap project cover
Stars
9
Forks
4
Last push (UTC)
Sep 19, 2022
Project status
Active
Federico Amura GitHub avatar
GITHUB User

Federico Amura ↗

LanguagesDart

Packages published by this repository

Dependencies used

Dependency list 2 items
  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

ScaleTap

Scale and opacity animated Button for Flutter

Getting Started

Wrap your widget with ScaleTap

ScaleTap(
  onPressed: (){
    //Tap
  },
  onLongPress: (){
    //Long press
  },
  child: Container(
    child: Text("Tap Me"),
  ),
)

You can change the default behaviour with the ScaleTapConfig class

class ScaleTapConfig {
  static double scaleMinValue = 0.95;
  static Curve scaleCurve = CurveSpring();
  static double opacityMinValue = 0.90;
  static Curve opacityCurve = Curves.ease;
  static Duration scaleOpacityAnimationDuration = const Duration(milliseconds: 300);
  static Duration buttonAnimationDuration = const Duration(milliseconds: 300);
}