todo-app/lib/ui/motion.dart
Krzysztof kuhy Rudnicki 2ffae26f93 Capture feedback: haptic + checkmark on commit, motion tokens for routes and wizard bar
- Committing a captured note (New note tap with a persisted draft) fires
  HapticFeedback.lightImpact and plays a ~600 ms checkmark beside the counter;
  empty drafts and keystrokes confirm nothing.
- appRoute: one shared page route (fade + rise, AppDuration.slow) replaces all
  seven MaterialPageRoute sites; guard test keeps it that way.
- Wizard progress bar animates on AppDuration.base / AppCurve.standard.
- Everything honours disableAnimations; the haptic and the (static) checkmark
  still fire. Removes the finished dopamine-ux prompt (sound step rejected).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:28:13 +01:00

11 lines
455 B
Dart

/// Reduced-motion handling shared by every animated surface.
library;
import 'package:design_system/design_system.dart';
import 'package:flutter/widgets.dart';
/// [token] unless the OS "remove animations" setting is on, in which case
/// [AppDuration.instant]. Haptics are not motion and never go through this.
Duration motionDuration(BuildContext context, Duration token) =>
MediaQuery.disableAnimationsOf(context) ? AppDuration.instant : token;