mouse_parallax 0.3.0 copy "mouse_parallax: ^0.3.0" to clipboard
mouse_parallax: ^0.3.0 copied to clipboard

outdated

A simple way to implement pointer based parallax animations on multiple platforms.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

/// Example app.
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: ParallaxStack(
          resetOnExit: true,
          layers: [
            ParallaxLayer(
              yRotation: -0.35,
              xRotation: 0.35,
              xOffset: 60,
              enable3D: true,
              center: true,
              child: Container(
                width: 250,
                height: 250,
                color: Colors.black,
              ),
            ),
            ParallaxLayer(
              yRotation: -0.4,
              xRotation: 0.35,
              xOffset: 80,
              enable3D: true,
              center: true,
              child: Container(
                width: 200,
                height: 200,
                decoration: const BoxDecoration(
                  color: Colors.deepOrange,
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
158
likes
40
pub points
59%
popularity

Publisher

unverified uploader

A simple way to implement pointer based parallax animations on multiple platforms.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on mouse_parallax