Skip to content

Instantly share code, notes, and snippets.

View fredgrott's full-sized avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 19:05
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]);
}
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 15:25
motor, more complex builder material
import 'package:motor/motor.dart';
MotionBuilder(
motion: MaterialSpringMotion.expressiveSpatialDefault,
value: const Offset(100, 100),
from: Offset.zero,
converter: OffsetMotionConverter(),
builder: (context, value, child) {
return Transform.translate(
offset: value,
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 15:13
motor, more complex builder
import 'package:motor/motor.dart';
MotionBuilder(
motion: CupertinoMotion.bouncy(),
value: const Offset(100, 100),
from: Offset.zero,
converter: OffsetMotionConverter(),
builder: (context, value, child) {
return Transform.translate(
offset: value,
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 15:12
motor, building motion in one dimension
import 'package:motor/motor.dart';
SingleMotionBuilder(
motion: CupertinoMotion.bouncy(),
value: targetValue, // Changes trigger smooth spring animation
builder: (context, value, child) {
return Container(
width: value,
height: value,
color: Colors.blue,
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 13:57
motor, custom material spring
import 'package:motor/motor.dart'
final customMaterial = MaterialSpringMotion(
damping: 0.8,
stiffness: 500,
);
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 13:35
motor, custom CupertinoMotion instance
import 'package:motor/motor.dart';
final customMotion = CupertinoMotion(
duration: Duration(milliseconds: 600),
bounce: 0.3,
);
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 13:27
motor, how to get M3E spring motion
import 'package:motor/motor.dart';
// Physics-based motion (natural, responsive)
final spring = CupertinoMotion.bouncy(); // Or `Motion.bouncySpring()`
final material = MaterialSpringMotion.standardSpatialDefault();
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 13:20
motor, legacy curve
import 'package:motor/motor.dart'
AnimatedContainer(
duration: const Duration(milliseconds: 500),
curve: MotionCurve(spring: CupertinoMotion.bouncy, velocity: .3),
height: size,
width: size,
color: Colors.blue,
),
@fredgrott
fredgrott / snippet.dart
Created October 18, 2025 13:17
motor legacy md3 motion
impoart 'package:motor/motor.dart';
// Duration-based motion (traditional Flutter approach)
final linear = Motion.linear(Duration(seconds: 1));
final withCurve = Motion.curved(Duration(seconds: 1), Curves.easeInOut);
@fredgrott
fredgrott / snippet.txt
Created October 11, 2025 19:10
terminal commands to turn off Liquid Glass
defaults write -g com.apple.SwiftUI.DisableSolarium -bool YES
defaults write com.apple.finder com.apple.SwiftUI.DisableSolarium -bool YES
defaults write com.apple.Preview com.apple.SwiftUI.DisableSolarium -bool YES
then restart or do these commands
killall finder
killall Preview