FLUTTER ECOSYSTEM

wilsonowilson/mouse_parallax

wilsonowilson/mouse_parallax open-source repository details.

mouse_parallax のプロジェクト画像
Stars
74
Forks
10
最終プッシュ(UTC)
2021/02/27
プロジェクト状態
公開中
Wilson Wilson GitHub avatar
GITHUB User

Wilson Wilson ↗

Svelte Enthusiast. Currently building ferndesk.com. Learning French 🇫🇷 and occasionally dreaming in Typescript.

言語DartHTMLSwiftRuby

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件
  • flutter{"sdk":"flutter"}
  • very_good_analysis開発用^1.0.4
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

mouse_parallax

Mouse Parallax

A Pointer-Based Animation Package. The goal of this package is to make mouse and touch based parallax effects as simple as possible.

Setting up

To get started with the Parallax effect, use a ParallaxStack

class MyApp extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: ParallaxStack(
         layers: [],
       ),
     ),
   );
 }
}

The layers property takes a list of ParallaxLayers. These layers allow you to define the animatable properties of the stack.

class MyApp extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: ParallaxStack(
         layers: [
           ParallaxLayer(
             yRotation: 0.35,
             xOffset: 60,
             child: Center(
               child: Container(
                 width: 250,
                 height: 250,
                 color: Colors.black,
               ),
             ),
           ),
           ParallaxLayer(
             yRotation: 0.35,
             xOffset: 80,
             child: Center(
               child: Container(
                 width: 200,
                 height: 200,
                 decoration: const BoxDecoration(
                   color: Colors.deepOrange,
                 ),
               ),
             ),
           ),
         ],
       ),
     ),
   );
 }
}

That example yields this result:

Parallax image