Created
October 20, 2025 19:36
-
-
Save fredgrott/87087d5699aa82360d806e470c5c8883 to your computer and use it in GitHub Desktop.
motor, sequence motion controller
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 = SequenceMotionController<ButtonState, Offset>( | |
| motion: Motion.smoothSpring(), | |
| vsync: this, | |
| converter: MotionConverter.offset, | |
| initialValue: Offset.zero, | |
| ); | |
| final sequence = MotionSequence.states({ | |
| ButtonState.idle: Offset(0, 0), | |
| ButtonState.pressed: Offset(0, 5), | |
| }, motion: Motion.smoothSpring()); | |
| await controller.playSequence(sequence); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment