mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-16 02:35:59 -07:00
fix: Long press "play" button with dpad navigation
This commit is contained in:
parent
fd35ffb004
commit
3ce0ed6dbc
9 changed files with 188 additions and 121 deletions
|
|
@ -81,7 +81,12 @@ class _BookDetailScreenState extends ConsumerState<BookDetailScreen> {
|
|||
//Wrapped so the correct context is used for refreshing the pages
|
||||
return MediaPlayButton(
|
||||
item: details.nextUp!,
|
||||
onPressed: () async => details.nextUp.play(context, ref, provider: provider),
|
||||
onPressed: (restart) async => details.nextUp.play(
|
||||
context,
|
||||
ref,
|
||||
provider: provider,
|
||||
currentPage: restart ? 0 : null,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -82,12 +82,21 @@ class _ItemDetailScreenState extends ConsumerState<EpisodeDetailScreen> {
|
|||
playButton: episodeDetails.playAble
|
||||
? MediaPlayButton(
|
||||
item: episodeDetails,
|
||||
onPressed: () async {
|
||||
await details.episode.play(context, ref);
|
||||
onPressed: (restart) async {
|
||||
await details.episode.play(
|
||||
context,
|
||||
ref,
|
||||
startPosition: restart ? Duration.zero : null,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
onLongPressed: () async {
|
||||
await details.episode.play(context, ref, showPlaybackOption: true);
|
||||
onLongPressed: (restart) async {
|
||||
await details.episode.play(
|
||||
context,
|
||||
ref,
|
||||
showPlaybackOption: true,
|
||||
startPosition: restart ? Duration.zero : null,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -75,18 +75,20 @@ class _ItemDetailScreenState extends ConsumerState<MovieDetailScreen> {
|
|||
padding: padding,
|
||||
playButton: MediaPlayButton(
|
||||
item: details,
|
||||
onLongPressed: () async {
|
||||
onLongPressed: (restart) async {
|
||||
await details.play(
|
||||
context,
|
||||
ref,
|
||||
showPlaybackOption: true,
|
||||
startPosition: restart ? Duration.zero : null,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
onPressed: () async {
|
||||
onPressed: (restart) async {
|
||||
await details.play(
|
||||
context,
|
||||
ref,
|
||||
startPosition: restart ? Duration.zero : null,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -76,21 +76,28 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
|
|||
OverviewHeader(
|
||||
name: details.name,
|
||||
image: details.images,
|
||||
playButton: MediaPlayButton(
|
||||
item: details.nextUp,
|
||||
onPressed: details.nextUp != null
|
||||
? () async {
|
||||
await details.nextUp.play(context, ref);
|
||||
playButton: details.nextUp != null
|
||||
? MediaPlayButton(
|
||||
item: details.nextUp,
|
||||
onPressed: (restart) async {
|
||||
await details.nextUp.play(
|
||||
context,
|
||||
ref,
|
||||
startPosition: restart ? Duration.zero : null,
|
||||
);
|
||||
ref.read(providerId.notifier).fetchDetails(widget.item);
|
||||
}
|
||||
: null,
|
||||
onLongPressed: details.nextUp != null
|
||||
? () async {
|
||||
await details.nextUp.play(context, ref, showPlaybackOption: true);
|
||||
},
|
||||
onLongPressed: (restart) async {
|
||||
await details.nextUp.play(
|
||||
context,
|
||||
ref,
|
||||
showPlaybackOption: true,
|
||||
startPosition: restart ? Duration.zero : null,
|
||||
);
|
||||
ref.read(providerId.notifier).fetchDetails(widget.item);
|
||||
}
|
||||
: null,
|
||||
),
|
||||
},
|
||||
)
|
||||
: null,
|
||||
centerButtons: Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue