Enter the Flutter page animation

Making: github.com/wuweijian19…

Installing

Add this to your package’s pubspec.yaml file:

Dependencies: animation_page: ^ 0.0.1Copy the code

Custom

@ override buildTransform Animation (Animation) {return Matrix4. TranslationValues (50 * (1.0 - Animation. The value), 50 * (1.0-animation.value), 0.0); }Copy the code

Example

demo code

class DemoPage extends StatefulWidget { @override _DemoPageState createState() => _DemoPageState(); } class _DemoPageState extends State<DemoPage> with TickerProviderStateMixin, AnimationPageMixin { AnimationController controller; @override void initState() { super.initState(); controller = AnimationController(duration: animationPageDuration, vsync: this); controller.forward(); } @override Widget build(BuildContext context) { return Scaffold( body: ListView( children: initAnimation(widgetList, controller), ), ); } List<Widget> widgetList = [Padding(Padding: const EdgeInsets. All (8.0), child: height: 200, child: RaisedButton( onPressed: () {}, color: Colors.blue, child: Icon(Icons.add, size: 50,), ), ), ), Padding( padding: Const EdgeInsets. All (8.0), child: Container(color: Colors. Red, child: Image. Asset ('assets/eat_cape_town_sm.jpg', height: 200,),),), Padding(const EdgeInsets. All (8.0), child: Container( height: 200, color: Colors.green, child: Center( child: Text( 'Hello World', style: TextStyle( fontSize: 2),),),),),), (Padding: const EdgeInsets. All (8.0), child: height: 200, color: Colors.pink, ), ), ]; }Copy the code

example 1

@ override buildTransform Animation (Animation) {return Matrix4. TranslationValues (20 * (1.0 - Animation. The value), 20 * (1.0-animation.value), 0.0); }Copy the code

example 2

@ override buildTransform Animation (Animation) {return Matrix4. TranslationValues (30 * (1.0 - Animation. The value), 0, 0.0);  }Copy the code

example 3

@ override buildTransform Animation (Animation) {return Matrix4. TranslationValues (0, 30 * (1.0 - Animation. The value), 0.0);  }Copy the code

example 4

@ override buildTransform Animation (Animation) {return Matrix4. TranslationValues (0, 30 * (1.0 - Animation. The value), 0.0); }Copy the code