visual_effect 0.0.2 copy "visual_effect: ^0.0.2" to clipboard
visual_effect: ^0.0.2 copied to clipboard

VisualEffect API for Flutter to easily add paint effects on your widgets.

visual_effect #

VisualEffect API for Flutter to easily add paint effects on your widgets.

Warning This package is experimental for the moment. The API can change at any time.

Scroll Effect #

The main purpose of this API is to provide an easy and efficiently way to apply scroll animations.

For example this Card Stack effect can be obtained with the code below:

Card Stack

class _ScrolledItem extends StatelessWidget {
  const _ScrolledItem();

  @override
  Widget build(BuildContext context) {
    return ScrollEffect(
      onGenerateVisualEffect: (effect, phase) {
        return effect
            .grayscale(phase.leadingLerp(to: 0.5))
            .scale(
              phase.isLeading ? phase.leadingLerp(from: 1, to: 0.9) : 1,
              anchor: Alignment.topCenter,
            )
            .translate(y: effect.childSize.height * phase.leading);
      },
      child: const _CardItem(),
    );
  }
}
60
likes
0
pub points
54%
popularity

Publisher

verified publisherromainrastel.com

VisualEffect API for Flutter to easily add paint effects on your widgets.

Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

flutter, meta, vector_math

More

Packages that depend on visual_effect