Bram  Vanbilsen
Bram Vanbilsen

Reputation: 6505

Flutter: Using the SlideTransition

I'm confused on how to use the SlideTransition, especially about the Position property. Atm I've got an AnimationBuilder in which I want to use a SlideTransition and an AnimationController. How would I get the position of the child of the AnimationBuilder? Or is that not what has to be passed to the Position property? Perhaps a small example would help!

Upvotes: 10

Views: 7658

Answers (1)

Ian Hickson
Ian Hickson

Reputation: 8600

AnimationBuilder and SlideTransition are peers, you'd use one or the other (or both in parallel), you don't use one to use the other.

You want to create an Animation<FractionalOffset> from your AnimationController, typically using a Tween<FractionalOffset>.

See, e.g., https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/drawer_demo.dart

Upvotes: 7

Related Questions