Created
October 20, 2025 18:39
-
-
Save fredgrott/1841cd9204ec4ed1913d877c99635354 to your computer and use it in GitHub Desktop.
motor, advance phase motion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:motor/motor.dart'; | |
| final controller = PhaseMotionController<ButtonState, Offset>( | |
| motion: .smoothSpring(), | |
| vsync: this, | |
| converter: .offset, | |
| initialValue: .zero, | |
| ); | |
| // Play a sequence | |
| await controller.playSequence(buttonSequence); | |
| // Check current state | |
| if (controller.isPlayingSequence) { | |
| print('Current phase: ${controller.currentSequencePhase}'); | |
| print('Progress: ${controller.sequenceProgress}'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment