fading_image_button 0.10.0+0
fading_image_button: ^0.10.0+0 copied to clipboard

A Flutter image button widget, that fades between default and pressed state.

fading_image_button #

Animated Flutter image button widget.

About #

It fades between pressed and default state. On onTapUp event after half the animation duration, the onPress function is triggered. Both images are cached to avoid longer initial loading time.

Getting Started #

Widget build(BuildContext context) {
    return FadingImageButton(
        onPressed: () => print(pressed),
        image: Image.asset("assets/button.png"),
        onPressedImage: Image.asset("assets/button-pressed.png"),
    );
}

Properties #

propertydescriptiondefault
onPressedFunction that is called on onTapUp event.
imageImage of the button.
onPressedImageOverlay image. It is triggered on onTapDown event.
widthButton width.128
heightButton height.128
paddingPadding of the container widget. Therefore actually margin of the images.all: 5
durationDuration of the fading animation.250ms

Fat properties are required.

0
likes
120
pub points
61%
popularity

Publisher

michm.de

A Flutter image button widget, that fades between default and pressed state.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on fading_image_button