mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 11:22:16 +08:00
* tweak
* Reapply "opt: audio uri" (#1833)
This reverts commit 8e726f49b2.
* opt: player
* opt: player
* refa: create player
* refa: player
* opt: UaType
* fix: sb seek preview
* opt: setSub
* fix: screenshot
* opt: unnecessary final player state
* opt: player track
* opt FileSource constructor [skip ci]
* fixes
* fix: dispose player
* fix: quote
* update
* fix: multi ua & remove unused loop
* remove unneeded check [skip ci]
---------
Co-authored-by: dom <githubaccount56556@proton.me>
73 lines
1.9 KiB
Dart
73 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class PublishRoute<T> extends PopupRoute<T> {
|
|
PublishRoute({
|
|
required RoutePageBuilder pageBuilder,
|
|
bool barrierDismissible = true,
|
|
String? barrierLabel,
|
|
Color barrierColor = const Color(0x80000000),
|
|
Duration transitionDuration = const Duration(milliseconds: 500),
|
|
RouteTransitionsBuilder? transitionBuilder,
|
|
super.settings,
|
|
}) : widget = pageBuilder,
|
|
_barrierDismissible = barrierDismissible,
|
|
_barrierLabel = barrierLabel,
|
|
_barrierColor = barrierColor,
|
|
_transitionDuration = transitionDuration,
|
|
_transitionBuilder = transitionBuilder;
|
|
|
|
final RoutePageBuilder widget;
|
|
|
|
@override
|
|
bool get barrierDismissible => _barrierDismissible;
|
|
final bool _barrierDismissible;
|
|
|
|
@override
|
|
String? get barrierLabel => _barrierLabel;
|
|
final String? _barrierLabel;
|
|
|
|
@override
|
|
Color get barrierColor => _barrierColor;
|
|
final Color _barrierColor;
|
|
|
|
@override
|
|
Duration get transitionDuration => _transitionDuration;
|
|
final Duration _transitionDuration;
|
|
|
|
final RouteTransitionsBuilder? _transitionBuilder;
|
|
|
|
@override
|
|
Widget buildPage(
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
) {
|
|
return Semantics(
|
|
scopesRoute: true,
|
|
explicitChildNodes: true,
|
|
child: widget(context, animation, secondaryAnimation),
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget buildTransitions(
|
|
BuildContext context,
|
|
Animation<double> animation,
|
|
Animation<double> secondaryAnimation,
|
|
Widget child,
|
|
) {
|
|
if (_transitionBuilder != null) {
|
|
return _transitionBuilder(context, animation, secondaryAnimation, child);
|
|
}
|
|
return SlideTransition(
|
|
position: animation.drive(
|
|
Tween<Offset>(
|
|
begin: const Offset(0.0, 1.0),
|
|
end: Offset.zero,
|
|
),
|
|
),
|
|
child: child,
|
|
);
|
|
}
|
|
}
|