Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created October 20, 2025 19:36
Show Gist options
  • Save fredgrott/87087d5699aa82360d806e470c5c8883 to your computer and use it in GitHub Desktop.
Save fredgrott/87087d5699aa82360d806e470c5c8883 to your computer and use it in GitHub Desktop.
motor, sequence motion controller
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