Pato05
f126ffef46
use get_url api by default, and fall back to old generation if get_url failed start to write a better cachemanager to implement in all systems write in more appropriate directories on windows and linux improve check for Connectivity by adding a fallback (needed for example on linux systems without NetworkManager) allow to dynamically change track quality without rebuilding the object
51 lines
1.3 KiB
Dart
51 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:freezer/page_routes/basic_page_route.dart';
|
|
import 'package:freezer/ui/animated_blur.dart';
|
|
|
|
class FadePageRoute<T> extends BasicPageRoute<T> {
|
|
@override
|
|
final bool barrierDismissible;
|
|
@override
|
|
final Color barrierColor;
|
|
@override
|
|
final bool opaque;
|
|
|
|
final WidgetBuilder builder;
|
|
final bool blur;
|
|
FadePageRoute({
|
|
required this.builder,
|
|
this.blur = false,
|
|
super.transitionDuration,
|
|
super.maintainState,
|
|
super.settings,
|
|
this.barrierColor = Colors.black38,
|
|
this.barrierDismissible = false,
|
|
this.opaque = true,
|
|
});
|
|
|
|
@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 baseTransition = FadeTransition(
|
|
opacity: animation,
|
|
child: child,
|
|
);
|
|
if (blur) {
|
|
return Stack(children: [
|
|
Positioned.fill(
|
|
child: AnimatedBlur(
|
|
animation: animation,
|
|
multiplier: 10.0,
|
|
child: const SizedBox())),
|
|
baseTransition,
|
|
]);
|
|
}
|
|
return baseTransition;
|
|
}
|
|
}
|