Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created October 20, 2025 18:39
Show Gist options
  • Save fredgrott/1841cd9204ec4ed1913d877c99635354 to your computer and use it in GitHub Desktop.
Save fredgrott/1841cd9204ec4ed1913d877c99635354 to your computer and use it in GitHub Desktop.
motor, advance phase motion
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