mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-13 17:30:31 -07:00
feature: Handle all media segments skipping (#167)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
7877cae8ea
commit
a06591084b
4 changed files with 54 additions and 66 deletions
|
|
@ -60,47 +60,26 @@ class OpenQueueButton extends ConsumerWidget {
|
|||
}
|
||||
}
|
||||
|
||||
class IntroSkipButton extends ConsumerWidget {
|
||||
class SkipSegmentButton extends ConsumerWidget {
|
||||
final String label;
|
||||
final bool isOverlayVisible;
|
||||
|
||||
final Function()? skipIntro;
|
||||
const IntroSkipButton({this.skipIntro, required this.isOverlayVisible, super.key});
|
||||
final Function() pressedSkip;
|
||||
const SkipSegmentButton({required this.label, required this.isOverlayVisible, required this.pressedSkip, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return ElevatedButton(
|
||||
onPressed: () => skipIntro?.call(),
|
||||
style: ElevatedButton.styleFrom(shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [Text("(S)kip Intro"), Icon(Icons.skip_next_rounded)],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class OutroSkipButton extends ConsumerWidget {
|
||||
final bool isOverlayVisible;
|
||||
final Function()? skipOutro;
|
||||
const OutroSkipButton({this.skipOutro, required this.isOverlayVisible, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
// final semiHideSkip = skipCredits.
|
||||
return AnimatedOpacity(
|
||||
opacity: 1,
|
||||
duration: const Duration(milliseconds: 250),
|
||||
opacity: isOverlayVisible ? 0.85 : 0,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
child: ElevatedButton(
|
||||
onPressed: () => skipOutro?.call(),
|
||||
onPressed: pressedSkip,
|
||||
style: ElevatedButton.styleFrom(shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [Text("(S)kip Credits"), Icon(Icons.skip_next_rounded)],
|
||||
children: [Text(label), const Icon(Icons.skip_next_rounded)],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue