mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-11 13:27:46 +01:00
- 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>
51 lines
1.3 KiB
Dart
51 lines
1.3 KiB
Dart
/// The one page route every screen is pushed with, on the shared motion tokens.
|
|
library;
|
|
|
|
import 'package:design_system/design_system.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:todo/ui/motion.dart';
|
|
|
|
/// A route for [builder]: fade plus a short rise over [AppDuration.slow],
|
|
/// instant under the OS "remove animations" setting.
|
|
Route<T> appRoute<T>(BuildContext context, WidgetBuilder builder) =>
|
|
_AppPageRoute<T>(
|
|
builder: builder,
|
|
duration: motionDuration(context, AppDuration.slow),
|
|
);
|
|
|
|
class _AppPageRoute<T> extends MaterialPageRoute<T> {
|
|
_AppPageRoute({required super.builder, required this.duration});
|
|
|
|
final Duration duration;
|
|
|
|
@override
|
|
Duration get transitionDuration => duration;
|
|
|
|
@override
|
|
Duration get reverseTransitionDuration => duration;
|
|
|
|
@override
|
|
Widget buildTransitions(
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) {
|
|
final enter = CurvedAnimation(
|
|
parent: animation,
|
|
curve: AppCurve.decelerate,
|
|
reverseCurve: AppCurve.accelerate,
|
|
);
|
|
return FadeTransition(
|
|
opacity: enter,
|
|
child: SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(0, 0.04),
|
|
end: Offset.zero,
|
|
).animate(enter),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
}
|