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

Parallax effect animations for all platforms.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:parallax_effect/parallax_effect.dart';

void main() {
  runApp(const MyApp());
}
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Parllax Page'),
    );
  }
}
class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Parallax(
          height: 400,
          width: 400,
          enableDrag: true,
          items: List.generate(
              5,
              (index) => ParallaxItem(
                  factor: ParallaxFactor(x: 0.05 * index, y: 0.05 * index),
                  rotationFactor: ParallaxFactor(x: 0, y: 0.05 * index),
                  child:
                      Container(height: 50, width: 50, color: Colors.green))),
        ));
  }
}
39
likes
120
pub points
66%
popularity

Publisher

verified publisherketansharma.tk

Parallax effect animations for all platforms.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on parallax_effect