Pato05
950969b774
add favorite button in notifications\nfix android tv\ntry to fix library tracks (unsuccessful)\nbetter MenuSheet
30 lines
946 B
Dart
30 lines
946 B
Dart
import 'package:flutter/widgets.dart';
|
|
import 'package:freezer/page_routes/basic_page_route.dart';
|
|
|
|
class ScaleFadePageRoute<T> extends BasicPageRoute<T> {
|
|
final WidgetBuilder builder;
|
|
final Curve animationCurve;
|
|
final tween = Tween<double>(begin: 0.975, end: 1.0);
|
|
|
|
ScaleFadePageRoute({
|
|
required this.builder,
|
|
this.animationCurve = Curves.linearToEaseOut,
|
|
super.transitionDuration,
|
|
super.maintainState,
|
|
super.settings,
|
|
});
|
|
|
|
@override
|
|
Widget buildPage(BuildContext context, Animation<double> animation,
|
|
Animation<double> secondaryAnimation) =>
|
|
builder(context);
|
|
|
|
@override
|
|
Widget buildTransitions(BuildContext context, Animation<double> animation,
|
|
Animation<double> secondaryAnimation, Widget child) {
|
|
final a = tween
|
|
.animate(CurvedAnimation(parent: animation, curve: animationCurve));
|
|
return ScaleTransition(scale: a, child: child);
|
|
}
|
|
}
|