mirror of
https://github.com/stonega/tsacdop
synced 2024-12-17 10:50:43 +01:00
db54bf0bfa
One click to add new episodes to playlist Improve feedback options Bugs fixed
120 lines
3.2 KiB
Dart
120 lines
3.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'context_extension.dart';
|
|
|
|
//Slide Transition
|
|
class SlideLeftRoute extends PageRouteBuilder {
|
|
final Widget page;
|
|
SlideLeftRoute({this.page})
|
|
: super(
|
|
pageBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) =>
|
|
page,
|
|
transitionsBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) =>
|
|
SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(1, 0),
|
|
end: Offset.zero,
|
|
).animate(animation),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
|
|
class SlideLeftHideRoute extends PageRouteBuilder {
|
|
final Widget page;
|
|
SlideLeftHideRoute({this.page})
|
|
: super(
|
|
pageBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) =>
|
|
page,
|
|
transitionsBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) =>
|
|
SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(1, 0),
|
|
end: Offset.zero,
|
|
).animate(animation),
|
|
child: Container(
|
|
alignment: Alignment.topLeft,
|
|
child: SizedBox(
|
|
width: context.width,
|
|
height: context.height,
|
|
child: child),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
class SlideUptRoute extends PageRouteBuilder {
|
|
final Widget page;
|
|
SlideUptRoute({this.page})
|
|
: super(
|
|
pageBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) =>
|
|
page,
|
|
transitionsBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) =>
|
|
SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(0, 1),
|
|
end: Offset.zero,
|
|
).animate(animation),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
|
|
//Scale Pageroute
|
|
class ScaleRoute extends PageRouteBuilder {
|
|
final Widget page;
|
|
ScaleRoute({this.page})
|
|
: super(
|
|
pageBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) =>
|
|
page,
|
|
transitionsBuilder: (
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) =>
|
|
ScaleTransition(
|
|
scale: Tween<double>(
|
|
begin: 0.0,
|
|
end: 1.0,
|
|
).animate(
|
|
CurvedAnimation(
|
|
parent: animation,
|
|
curve: Curves.fastOutSlowIn,
|
|
),
|
|
),
|
|
child: child,
|
|
),
|
|
);
|
|
}
|