A Parallax effect package, Package is useful for animations for items in foreground, or background scrolling effect.
- Parallax movement with different stackable layers.
- Supports 3 dimensional rotation.
- Use
Parallax
widget for Configurations:- height: widget parent height
- width: widget parent width
- enableDrag: enables on click/tap movement
- item: children of type
ParallaxItem
- Use
ParallaxItem
widget for Configurations:- factor: ParallaxFactor(x,y)
- alignment: initial alignment of child
- rotationFactor: ParallaxFactor(x,y) for rotation
- child: child
TODO: Include short and useful examples for package users. Add longer examples
to /example
folder.
class ParallaxExample extends StatefulWidget {
const ParallaxExample({Key? key}) : super(key: key);
@override
State<ParallaxExample> createState() => _ParallaxState();
}
class _ParallaxState extends State<ParallaxExample>
with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Parallax(
height: 400,
width: 400,
enableDrag: true,
items: List.generate(5,(index)=>
ParallaxItem(
factor:ParallaxFactor(0.05*index,0.05*index),
rotationFactor: ParallaxFactor(0,0.05*index),
child: Container(
height:50,
width:50,
color: Colors.green
)
)),
);