Skip to content

Dev#288

Draft
timcreatedit wants to merge 13 commits into
mainfrom
dev
Draft

Dev#288
timcreatedit wants to merge 13 commits into
mainfrom
dev

Conversation

@timcreatedit

Copy link
Copy Markdown
Contributor

Description

Checklist

  • My PR title is in the style of conventional commits
  • All public facing APIs are documented with dartdoc
  • I have added tests to cover my changes

timcreatedit and others added 8 commits June 15, 2026 16:52
Introduces the ability for MotionConverters to provide directionality
information to MotionControllers, allowing them to report
`AnimationStatus.reverse` when animating towards a "smaller" value.

- Added DirectionalMotionConverter mixin for defining custom directionality logic.
- Added ComparableMotionConverter for automatic directionality on Comparable types.
- Added MotionConverter.customDirectional for ad-hoc directional converter creation.
- Updated MotionController to derive animation status (forward/reverse) from the converter's directionality.
- Updated README and code comments to reflect that status behavior is now dynamic.

BREAKING CHANGE: SingleMotionConverter and other comparable converters now report `AnimationStatus.reverse` when animating towards a smaller value. This affects consumers who relied on MotionController always reporting forward status.
BREAKING CHANGE: All spring motions now default `snapToEnd` to `true`. This ensures values settle at exact targets (e.g., 0.0 or 1.0), preventing UI issues when using conditionals based on the motion's value.

Example: when using `SingleMotionBuilder` to transition a widget in and out, and removing that widget from the tree on `value == 0`, the value would previously not settle at 0 by default, causing the widget to remain in the tree. This change fixes that behavior.

**Note:** This might introduce visual jumps in `MotionSequence`s. If you experience this, set `snapToEnd: false` on your spring motion instances used in sequences.

Migration:
If you rely on the previous behavior (where springs might settle slightly off-target due to physics simulation limits), set `snapToEnd: false` on your spring motion instances.
Add velocity tracking to MotionController for smooth motion continuity when
manually setting values. Velocity is automatically tracked during user
interactions and used when animating without explicit velocity.

BREAKING CHANGES:
- Velocity tracking is now enabled by default for all MotionControllers
- New `velocityTracking` parameter replaces internal implementation
- Use `VelocityTracking.off()` to disable tracking if needed

Perfect for interactions without velocity data (sliders, mouse tracking).
When gesture velocity is available (e.g., DragEndDetails), prefer using
`withVelocity` for better accuracy.
* ok

* fixes

* better api

* rename tradck efault to zero

* smaller track API surface

* another rename

* better readme imo

* fix loop mode

* feat: motionPerDimension for tracks

* stop on track controller settles if not cancelled

* feat!: base `MotionController` on `TrackController`

BREAKING CHANGE: Like `AnimationController`, `MotionController` used to synchronously emit
its initial value when an animation was started. This is no longer the case.

This can subtly change your state machines or animation timings.

* refactor(heroine)!: use motor 2.0 internally

BREAKING CHANGE: Motor 2.0 `MotionController` doesn't emit its initial value synchronously anymore.
This can subtly change heroine animation timings.

* build: remove springster from workspace
* feat(motor): redesign example app with Dia-inspired monochrome system

Rework the Motor example into a near-monochrome, Dia-inspired showcase that
demonstrates real product motion rather than abstract demos.

- example_design: replace the 6-accent palette with a quiet monochrome system
  (light + dark), a single soft shadow, generous radii, featherweight type,
  and a sparing spectrum gradient; add FrostedCard, NeutralButton, GhostPill,
  AmbientGlow, and TrajectoryLine primitives. Legacy token names are aliased
  onto the new palette so the stupid_simple_sheet example stays monochrome.
- Headline demo: Interruptible Motion graphs spring vs curve continuity with a
  ported value-recording notifier and trajectory line.
- Everyday UI: drawer, snap carousel (FrictionMotion.project), toggle, toast,
  segmented selector, accordion, and loaders (array of tracks + loop modes).
- Reframe showcases: now_playing (replaces the glow panel), staggered entrance
  (replaces the launch checklist); restyle card stack, title slide, flip card.
- Restyle gestures (draggable icons, picture-in-picture, drag reorder) to
  neutral/frosted; PiP now snaps via FrictionMotion.project.
- Rebuild the overview into Continuity / Everyday UI / Compose Motion / Gestures
  with monochrome previews; cut tap playground, velocity tracking, 2D
  redirection, and standalone loop modes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* refactor(motor)!: refine track API (optional initial, per-animation from/withVelocity, TrackBuilder)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

This is an automatic coverage report for 58bed7e, proudly generated by Dart Coverage Assistant 🎯🧪.

Monorepo coverage

This repository contains 7 Dart projects. This is is the total coverage across all of them:

77.00242718446601% - pass ⬆️ +1.65%

fixed_ticker

A drop-in Ticker replacement that uses Timer.periodic to gate frame callbacks at a fixed interval.

81.06796116504854% - pass ➡️ 0.00%

Coverage Details for fixed_ticker
File Line Percentage Line Count
lib/src
fixed_ticker_provider.dart 72.18 133
fixed_ticker.dart 95.35 43
ticker_rate.dart 100.00 16
ticker_rate_scope.dart 100.00 7
lib/src/testing
widget_tester_extensions.dart 100.00 7

heroine

The queen of hero transitions. Flutter's most addictive interactions.

66.50485436893204% - pass ➡️ 0.00%

Coverage Details for heroine
File Line Percentage Line Count
lib/src
drag_dismissable.dart 0.00 88
heroine_route_mixin.dart 0.00 24
heroine_velocity.dart 42.86 7
heroines.dart 78.23 147
flight_controller.dart 82.57 109
heroine_location.dart 85.71 21
heroine_widget.dart 97.78 90
heroine_transition_details.dart 100.00 1
flight_spec.dart 80.00 35
shuttle_builders.dart 70.83 96

motor

A unified motion system for Flutter - physics-based springs and duration-based curves under one API.

79.05433430111987% - pass ⬆️ +3.80%

Coverage Details for motor
File Line Percentage Line Count
lib/src
motion.dart 63.28 305
motion_converter.dart 84.04 94
motion_curve.dart 75.00 8
motion_sequence.dart 75.00 160
motion_velocity_tracker.dart 87.50 56
phase_transition.dart 48.00 25
step.dart 38.89 18
track.dart 94.74 38
track_phase_timeline.dart 97.92 48
track_timeline.dart 100.00 6
loop_mode.dart 100.00 1
lib/src/controllers
motion_controller.dart 94.63 149
phase_track_controller.dart 91.46 82
single_motion_controller.dart 100.00 4
track_controller.dart 94.36 195
_track_slot.dart 83.33 72
lib/src/controllers/legacy
legacy_motion_controller.dart 66.67 396
lib/src/simulations
step_playback.dart 94.35 230
curve_simulation.dart 100.00 15
no_motion_simulation.dart 100.00 7
lib/src/widgets
motion_builder.dart 100.00 11
motion_draggable.dart 83.50 103
phase_track_builder.dart 82.00 50
sequence_motion_builder.dart 94.90 98
track_builder.dart 86.79 53
velocity_motion_builder.dart 84.62 13
base_motion_builder.dart 78.00 50
lib/src/widgets/layout
padding_extended.dart 50.45 111
lib/src/widgets/motion
motion_padding.dart 0.00 13

rivership

An opinionated infrastructure package for use with hooks_riverpod.

61.712846347607055% - pass ➡️ 0.00%

Coverage Details for rivership
File Line Percentage Line Count
lib/src/design
blend_color_tween.dart 0.00 4
simple_widget_states.dart 0.00 11
lib/src/extensions
async_value_tools.dart 50.00 2
brightness_tools.dart 100.00 4
date_time_tools.dart 90.57 53
duration_formatting.dart 100.00 10
hct_tools.dart 14.29 14
iterable_tools.dart 100.00 24
object_try_as.dart 100.00 1
ref_cache.dart 28.57 14
string_if_not_empty.dart 100.00 1
lib/src/hooks
use_date_format.dart 0.00 8
use_delayed.dart 100.00 15
use_fixed_extent_scroll_controller.dart 100.00 15
use_keyed_state.dart 76.47 17
use_motion.dart 67.27 55
use_motion_utils.dart 20.00 10
use_page.dart 100.00 14
use_tween_animation.dart 85.48 62
lib/src/widgets
animated_size_switcher.dart 2.63 38
animated_text.dart 0.00 25

snaptest

Snap photos in your widget tests.

71.78631051752922% - pass ➡️ 0.00%

Coverage Details for snaptest
File Line Percentage Line Count
lib/src
clean.dart 71.43 7
font_loading.dart 52.67 150
screenshot_test_function.dart 100.00 8
snap.dart 91.60 262
snaptest_settings.dart 45.45 11
test_devices_variant.dart 100.00 13
blocked_text_painting_context.dart 51.59 126
util.dart 62.50 16
flutter_sdk_root.dart 83.33 6

stupid_simple_sheet

A simple sheet widget for Flutter.

90.61538461538461% - pass ⬇️ -0.31%

Coverage Details for stupid_simple_sheet
File Line Percentage Line Count
lib
stupid_simple_sheet.dart 92.21 231
lib/src
clamped_animation.dart 100.00 9
cupertino_sheet_copy.dart 100.00 83
optimized_clip.dart 65.00 20
glass_sheet_transitions.dart 92.86 28
sheet_background.dart 70.00 30
sheet_dismissal_transition.dart 100.00 17
shrink_transition.dart 98.00 50
snapping_point.dart 87.84 74
stupid_simple_cupertino_sheet.dart 81.25 48
stupid_simple_glass_sheet.dart 90.00 60

stupid_simple_sheet_example

"A new Flutter project."

93.65079365079364% - pass ⬇️ -1.90%

Coverage Details for stupid_simple_sheet_example
File Line Percentage Line Count
lib/widgets
sheet_logo.dart 93.65 63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant