pressable 0.12.0 copy "pressable: ^0.12.0" to clipboard
pressable: ^0.12.0 copied to clipboard

Touch effects to your widgets for ripple, scale, opacity, fill, and custom effects.

Pressable #

Quickly add tap effects to your widgets.

Usage #

final widget = PressableOpacity(
  onPressed: () {
    print('Opacity pressed');
  },
  onLongPressStart: () {
    print('Long Press start');
  },
  onLongPressEnd: () {
    print('Long Press End')
  },
  child: const ExampleButton(title: 'Opacity'),
);

Supported effects:

  • Scale
  • Opacity
  • Custom Builder

Default Theme #

You can use DefaultPressableTheme InheritedWidget to provide default PressableTheme to its Widget subtree.

final widget = DefaultPressableTheme(
  scaleTheme: PressableThemeScale(
    scaleFactor: 0.5,
  ),
  child: PressableScale(
    onPressed: () {},
    child: const ExampleButton(title: 'Default theme'),
  ),
);
4
likes
160
points
215
downloads

Publisher

verified publishervojtech.net

Weekly Downloads

Touch effects to your widgets for ripple, scale, opacity, fill, and custom effects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on pressable