MotionPlayer.bound constructor
MotionPlayer.bound(
- Playable playable, {
- required TickerProvider? vsync,
Plays a motion already bound to its scene — the BoundMotion the editor makes from a file it read, or any playable tree.
vsync is required and nullable, which is the point: passing null
gives a ticker that runs whether or not anything is on screen, and
that is a decision (a test, a headless walk) rather than something to
leave out by accident. An app passes one — a player still ticking
behind a pushed route is what a TickerProvider is for.
Implementation
MotionPlayer.bound(this.playable, {required TickerProvider? vsync}) {
_ticker = vsync?.createTicker(_tick) ?? Ticker(_tick);
}