Agrega PRIVACY.md, actualiza AGENTS.md
This commit is contained in:
29
lib/utils/transitions.dart
Normal file
29
lib/utils/transitions.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SmoothPageTransitionBuilder extends PageTransitionsBuilder {
|
||||
const SmoothPageTransitionBuilder();
|
||||
|
||||
@override
|
||||
Widget buildTransitions<T>(
|
||||
PageRoute<T> route,
|
||||
BuildContext context,
|
||||
Animation<double> animation,
|
||||
Animation<double> secondaryAnimation,
|
||||
Widget child,
|
||||
) {
|
||||
const begin = Offset(0.0, 0.04);
|
||||
const end = Offset.zero;
|
||||
const curve = Curves.easeInOutCubic;
|
||||
final tween = Tween(begin: begin, end: end).chain(
|
||||
CurveTween(curve: curve),
|
||||
);
|
||||
final fadeTween = Tween<double>(begin: 0.0, end: 1.0);
|
||||
return SlideTransition(
|
||||
position: animation.drive(tween),
|
||||
child: FadeTransition(
|
||||
opacity: animation.drive(fadeTween),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user