Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created October 18, 2025 19:05
Show Gist options
  • Save fredgrott/dfd9cb8ece571abe648fc9c960503222 to your computer and use it in GitHub Desktop.
Save fredgrott/dfd9cb8ece571abe648fc9c960503222 to your computer and use it in GitHub Desktop.
motor, motionconverter custom
import 'package:motor/motor.dart';
class My3DMotionConverter implements MotionConverter<Vector3> {
@override
List<double> normalize(Vector3 value) => [value.x, value.y, value.z];
@override
Vector3 denormalize(List<double> values) => Vector3(values[0], values[1], values[2]);
}
Widget build(BuildContext context) {
return MotionBuilder(
motion: CupertinoMotion.bouncy(),
value: Vector3(100, 100, 100),
converter: My3DMotionConverter(),
// ...
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment