mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: Lots of navigation improvements
This commit is contained in:
parent
c299492d6d
commit
5174bb3a6c
55 changed files with 1019 additions and 832 deletions
|
|
@ -49,7 +49,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||
|
||||
final textController = TextEditingController();
|
||||
|
||||
ItemBaseModel? selectedPoster;
|
||||
final selectedPoster = ValueNotifier<ItemBaseModel?>(null);
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -76,7 +76,9 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final padding = AdaptiveLayout.adaptivePadding(context);
|
||||
final bannerType = ref.watch(homeSettingsProvider.select((value) => value.homeBanner));
|
||||
final bannerType = AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad
|
||||
? HomeBanner.detailedBanner
|
||||
: ref.watch(homeSettingsProvider.select((value) => value.homeBanner));
|
||||
|
||||
final dashboardData = ref.watch(dashboardProvider);
|
||||
final views = ref.watch(viewsProvider);
|
||||
|
|
@ -99,10 +101,14 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||
return MediaQuery.removeViewInsets(
|
||||
context: context,
|
||||
child: NestedScaffold(
|
||||
background: BackgroundImage(
|
||||
items: selectedPoster != null
|
||||
? [selectedPoster!]
|
||||
: [...homeCarouselItems, ...dashboardData.nextUp, ...allResume]),
|
||||
background: ValueListenableBuilder<ItemBaseModel?>(
|
||||
valueListenable: selectedPoster,
|
||||
builder: (_, value, __) {
|
||||
return BackgroundImage(
|
||||
items: value != null ? [value] : [...homeCarouselItems, ...dashboardData.nextUp, ...allResume],
|
||||
);
|
||||
},
|
||||
),
|
||||
body: PullToRefresh(
|
||||
refreshKey: _refreshIndicatorKey,
|
||||
displacement: 80 + MediaQuery.of(context).viewPadding.top,
|
||||
|
|
@ -128,13 +134,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||
),
|
||||
child: HomeBannerWidget(
|
||||
posters: homeCarouselItems,
|
||||
onSelect: (selected) {
|
||||
// if (selectedPoster != selected) {
|
||||
// setState(() {
|
||||
// selectedPoster = selected;
|
||||
// });
|
||||
// }
|
||||
},
|
||||
onSelect: (poster) => selectedPoster.value = poster,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -218,7 +218,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||
.mapIndexed(
|
||||
(index, child) => SliverToBoxAdapter(
|
||||
child: FocusProvider(
|
||||
autoFocus: bannerType != HomeBanner.detailedBanner ? index == 0 : false,
|
||||
autoFocus:
|
||||
bannerType != HomeBanner.detailedBanner || homeCarouselItems.isEmpty ? index == 0 : false,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -76,10 +76,7 @@ class _BookDetailScreenState extends ConsumerState<BookDetailScreen> {
|
|||
OverviewHeader(
|
||||
subTitle: details.book?.parentName ?? details.parentModel?.name,
|
||||
name: details.nextUp?.name ?? "",
|
||||
image: ImagesData(
|
||||
logo: details.book?.getPosters?.primary,
|
||||
),
|
||||
centerButtons: Builder(
|
||||
playButton: Builder(
|
||||
builder: (context) {
|
||||
//Wrapped so the correct context is used for refreshing the pages
|
||||
return MediaPlayButton(
|
||||
|
|
@ -88,6 +85,9 @@ class _BookDetailScreenState extends ConsumerState<BookDetailScreen> {
|
|||
);
|
||||
},
|
||||
),
|
||||
image: ImagesData(
|
||||
logo: details.book?.getPosters?.primary,
|
||||
),
|
||||
productionYear: details.nextUp!.overview.productionYear,
|
||||
runTime: details.nextUp!.overview.runTime,
|
||||
genres: details.nextUp!.overview.genreItems,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import 'package:fladder/models/items/item_shared_models.dart';
|
|||
import 'package:fladder/screens/shared/media/components/chip_button.dart';
|
||||
import 'package:fladder/screens/shared/media/components/media_header.dart';
|
||||
import 'package:fladder/screens/shared/media/components/small_detail_widgets.dart';
|
||||
import 'package:fladder/theme.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
import 'package:fladder/util/humanize_duration.dart';
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
|
|
@ -14,6 +15,7 @@ import 'package:fladder/util/list_padding.dart';
|
|||
class OverviewHeader extends ConsumerWidget {
|
||||
final String name;
|
||||
final ImagesData? image;
|
||||
final Widget? playButton;
|
||||
final Widget? centerButtons;
|
||||
final EdgeInsets? padding;
|
||||
final String? subTitle;
|
||||
|
|
@ -30,6 +32,7 @@ class OverviewHeader extends ConsumerWidget {
|
|||
const OverviewHeader({
|
||||
required this.name,
|
||||
this.image,
|
||||
this.playButton,
|
||||
this.centerButtons,
|
||||
this.padding,
|
||||
this.subTitle,
|
||||
|
|
@ -59,7 +62,7 @@ class OverviewHeader extends ConsumerWidget {
|
|||
(MediaQuery.sizeOf(context).height - (MediaQuery.paddingOf(context).top + 150)).clamp(50, 1250).toDouble();
|
||||
|
||||
final crossAlignment =
|
||||
AdaptiveLayout.viewSizeOf(context) != ViewSize.phone ? CrossAxisAlignment.start : CrossAxisAlignment.center;
|
||||
AdaptiveLayout.viewSizeOf(context) != ViewSize.phone ? CrossAxisAlignment.start : CrossAxisAlignment.stretch;
|
||||
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
|
|
@ -156,7 +159,7 @@ class OverviewHeader extends ConsumerWidget {
|
|||
Flexible(
|
||||
child: Text(
|
||||
summary ?? "",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 3,
|
||||
),
|
||||
|
|
@ -168,7 +171,29 @@ class OverviewHeader extends ConsumerWidget {
|
|||
].addInBetween(const SizedBox(height: 10)),
|
||||
),
|
||||
),
|
||||
if (centerButtons != null) centerButtons!,
|
||||
if (AdaptiveLayout.viewSizeOf(context) == ViewSize.phone) ...[
|
||||
if (playButton != null) playButton!,
|
||||
if (centerButtons != null) centerButtons!,
|
||||
] else
|
||||
Flexible(
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
children: [
|
||||
if (playButton != null) ...[
|
||||
playButton!,
|
||||
Container(
|
||||
width: 2,
|
||||
height: 12,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.onSurface.withAlpha(64),
|
||||
borderRadius: FladderTheme.smallShape.borderRadius,
|
||||
),
|
||||
)
|
||||
],
|
||||
if (centerButtons != null) centerButtons!,
|
||||
],
|
||||
),
|
||||
),
|
||||
].addInBetween(const SizedBox(height: 21)),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -79,25 +79,25 @@ class _ItemDetailScreenState extends ConsumerState<EpisodeDetailScreen> {
|
|||
OverviewHeader(
|
||||
name: details.series?.name ?? "",
|
||||
image: seasonDetails.images,
|
||||
playButton: episodeDetails.playAble
|
||||
? MediaPlayButton(
|
||||
item: episodeDetails,
|
||||
onPressed: () async {
|
||||
await details.episode.play(context, ref);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
onLongPressed: () async {
|
||||
await details.episode.play(context, ref, showPlaybackOption: true);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
)
|
||||
: null,
|
||||
centerButtons: Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
alignment: wrapAlignment,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
episodeDetails.playAble
|
||||
? MediaPlayButton(
|
||||
item: episodeDetails,
|
||||
onPressed: () async {
|
||||
await details.episode.play(context, ref);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
onLongPressed: () async {
|
||||
await details.episode.play(context, ref, showPlaybackOption: true);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
)
|
||||
: null,
|
||||
SelectableIconButton(
|
||||
onPressed: () async {
|
||||
await ref
|
||||
|
|
@ -133,7 +133,7 @@ class _ItemDetailScreenState extends ConsumerState<EpisodeDetailScreen> {
|
|||
selected: false,
|
||||
icon: IconsaxPlusLinear.more,
|
||||
),
|
||||
].nonNulls.toList().addPadding(const EdgeInsets.symmetric(horizontal: 6)),
|
||||
].nonNulls.toList(),
|
||||
),
|
||||
padding: padding,
|
||||
subTitle: details.episode?.detailedName(context),
|
||||
|
|
|
|||
|
|
@ -73,30 +73,30 @@ class _ItemDetailScreenState extends ConsumerState<MovieDetailScreen> {
|
|||
name: details.name,
|
||||
image: details.images,
|
||||
padding: padding,
|
||||
playButton: MediaPlayButton(
|
||||
item: details,
|
||||
onLongPressed: () async {
|
||||
await details.play(
|
||||
context,
|
||||
ref,
|
||||
showPlaybackOption: true,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
onPressed: () async {
|
||||
await details.play(
|
||||
context,
|
||||
ref,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
),
|
||||
centerButtons: Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
alignment: wrapAlignment,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
MediaPlayButton(
|
||||
item: details,
|
||||
onLongPressed: () async {
|
||||
await details.play(
|
||||
context,
|
||||
ref,
|
||||
showPlaybackOption: true,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
onPressed: () async {
|
||||
await details.play(
|
||||
context,
|
||||
ref,
|
||||
);
|
||||
ref.read(providerInstance.notifier).fetchDetails(widget.item);
|
||||
},
|
||||
),
|
||||
SelectableIconButton(
|
||||
onPressed: () async {
|
||||
await ref
|
||||
|
|
|
|||
|
|
@ -76,27 +76,27 @@ 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);
|
||||
ref.read(providerId.notifier).fetchDetails(widget.item);
|
||||
}
|
||||
: null,
|
||||
onLongPressed: details.nextUp != null
|
||||
? () async {
|
||||
await details.nextUp.play(context, ref, showPlaybackOption: true);
|
||||
ref.read(providerId.notifier).fetchDetails(widget.item);
|
||||
}
|
||||
: null,
|
||||
),
|
||||
centerButtons: Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
alignment: wrapAlignment,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
MediaPlayButton(
|
||||
item: details.nextUp,
|
||||
onPressed: details.nextUp != null
|
||||
? () async {
|
||||
await details.nextUp.play(context, ref);
|
||||
ref.read(providerId.notifier).fetchDetails(widget.item);
|
||||
}
|
||||
: null,
|
||||
onLongPressed: details.nextUp != null
|
||||
? () async {
|
||||
await details.nextUp.play(context, ref, showPlaybackOption: true);
|
||||
ref.read(providerId.notifier).fetchDetails(widget.item);
|
||||
}
|
||||
: null,
|
||||
),
|
||||
SelectableIconButton(
|
||||
onPressed: () async {
|
||||
await ref
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ class LibraryRow extends ConsumerWidget {
|
|||
autoFocus: true,
|
||||
startIndex: selectedView != null ? views.indexOf(selectedView!) : null,
|
||||
contentPadding: padding,
|
||||
itemBuilder: (context, index, selected) {
|
||||
itemBuilder: (context, index) {
|
||||
final view = views[index];
|
||||
final isSelected = selectedView == view;
|
||||
final List<ItemActionButton> viewActions = [
|
||||
|
|
|
|||
|
|
@ -158,56 +158,61 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
extendBody: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
extendBodyBehindAppBar: true,
|
||||
floatingActionButton: HideOnScroll(
|
||||
controller: scrollController,
|
||||
visibleBuilder: (visible) => librarySearchResults.activePosters.isNotEmpty
|
||||
? FloatingActionButtonAnimated(
|
||||
key: Key(context.localized.playLabel),
|
||||
isExtended: visible,
|
||||
tooltip: context.localized.playVideos,
|
||||
onPressed: () async {
|
||||
if (librarySearchResults.showGalleryButtons && !librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.viewGallery(context);
|
||||
return;
|
||||
} else if (!librarySearchResults.showGalleryButtons && librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.playLibraryItems(context, ref);
|
||||
return;
|
||||
}
|
||||
floatingActionButton: AdaptiveLayout.inputDeviceOf(context) != InputDevice.dPad
|
||||
? HideOnScroll(
|
||||
controller: scrollController,
|
||||
visibleBuilder: (visible) => librarySearchResults.activePosters.isNotEmpty
|
||||
? FloatingActionButtonAnimated(
|
||||
key: Key(context.localized.playLabel),
|
||||
isExtended: visible,
|
||||
tooltip: context.localized.playVideos,
|
||||
onPressed: () async {
|
||||
if (librarySearchResults.showGalleryButtons && !librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.viewGallery(context);
|
||||
return;
|
||||
} else if (!librarySearchResults.showGalleryButtons &&
|
||||
librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.playLibraryItems(context, ref);
|
||||
return;
|
||||
}
|
||||
|
||||
await showLibraryPlayOptions(
|
||||
context,
|
||||
context.localized.libraryPlayItems,
|
||||
playVideos: librarySearchResults.showPlayButtons
|
||||
? () => libraryProvider.playLibraryItems(context, ref)
|
||||
: null,
|
||||
viewGallery: librarySearchResults.showGalleryButtons
|
||||
? () => libraryProvider.viewGallery(context)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
label: Text(context.localized.playLabel),
|
||||
icon: const Icon(IconsaxPlusBold.play),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
bottomNavigationBar: HideOnScroll(
|
||||
controller: scrollController,
|
||||
canHide: !floatingAppBar,
|
||||
child: IgnorePointer(
|
||||
ignoring: librarySearchResults.fetchingItems,
|
||||
child: _LibrarySearchBottomBar(
|
||||
uniqueKey: uniqueKey,
|
||||
refreshKey: refreshKey,
|
||||
scrollController: scrollController,
|
||||
libraryProvider: libraryProvider,
|
||||
postersList: postersList,
|
||||
),
|
||||
),
|
||||
),
|
||||
await showLibraryPlayOptions(
|
||||
context,
|
||||
context.localized.libraryPlayItems,
|
||||
playVideos: librarySearchResults.showPlayButtons
|
||||
? () => libraryProvider.playLibraryItems(context, ref)
|
||||
: null,
|
||||
viewGallery: librarySearchResults.showGalleryButtons
|
||||
? () => libraryProvider.viewGallery(context)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
label: Text(context.localized.playLabel),
|
||||
icon: const Icon(IconsaxPlusBold.play),
|
||||
)
|
||||
: null,
|
||||
)
|
||||
: null,
|
||||
bottomNavigationBar: AdaptiveLayout.inputDeviceOf(context) != InputDevice.dPad
|
||||
? HideOnScroll(
|
||||
controller: scrollController,
|
||||
canHide: !floatingAppBar,
|
||||
child: IgnorePointer(
|
||||
ignoring: librarySearchResults.fetchingItems,
|
||||
child: _LibrarySearchBottomBar(
|
||||
uniqueKey: uniqueKey,
|
||||
refreshKey: refreshKey,
|
||||
scrollController: scrollController,
|
||||
libraryProvider: libraryProvider,
|
||||
postersList: postersList,
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
body: PinchPosterZoom(
|
||||
scaleDifference: (difference) => ref.read(clientSettingsProvider.notifier).addPosterSize(difference),
|
||||
child: FladderScrollbar(
|
||||
visible: AdaptiveLayout.of(context).inputDevice != InputDevice.pointer,
|
||||
visible: AdaptiveLayout.inputDeviceOf(context) != InputDevice.pointer,
|
||||
controller: scrollController,
|
||||
child: PullToRefresh(
|
||||
refreshKey: refreshKey,
|
||||
|
|
@ -427,7 +432,7 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
],
|
||||
),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: const Size(0, 50),
|
||||
preferredSize: Size(0, AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad ? 105 : 50),
|
||||
child: Transform.translate(
|
||||
offset: Offset(0, AdaptiveLayout.of(context).isDesktop ? -20 : -15),
|
||||
child: IgnorePointer(
|
||||
|
|
@ -446,6 +451,15 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad)
|
||||
_LibrarySearchBottomBar(
|
||||
uniqueKey: uniqueKey,
|
||||
refreshKey: refreshKey,
|
||||
scrollController: scrollController,
|
||||
libraryProvider: libraryProvider,
|
||||
postersList: postersList,
|
||||
isDPadBar: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -496,12 +510,14 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
|
|||
final LibrarySearchNotifier libraryProvider;
|
||||
final List<ItemBaseModel> postersList;
|
||||
final GlobalKey<RefreshIndicatorState> refreshKey;
|
||||
final bool isDPadBar;
|
||||
const _LibrarySearchBottomBar({
|
||||
required this.uniqueKey,
|
||||
required this.scrollController,
|
||||
required this.libraryProvider,
|
||||
required this.postersList,
|
||||
required this.refreshKey,
|
||||
this.isDPadBar = false,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -586,155 +602,161 @@ class _LibrarySearchBottomBar extends ConsumerWidget {
|
|||
];
|
||||
|
||||
final paddingOf = MediaQuery.paddingOf(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: paddingOf.left, right: paddingOf.right),
|
||||
child: NestedBottomAppBar(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
Widget content = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 6,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 6,
|
||||
children: [
|
||||
ScrollStatePosition(
|
||||
controller: scrollController,
|
||||
positionBuilder: (state) => AnimatedFadeSize(
|
||||
child: state != ScrollState.top
|
||||
? Tooltip(
|
||||
message: context.localized.scrollToTop,
|
||||
child: IconButton.filled(
|
||||
onPressed: () => scrollController.animateTo(0,
|
||||
duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubic),
|
||||
icon: const Icon(
|
||||
IconsaxPlusLinear.arrow_up,
|
||||
),
|
||||
if (!isDPadBar)
|
||||
ScrollStatePosition(
|
||||
controller: scrollController,
|
||||
positionBuilder: (state) => AnimatedFadeSize(
|
||||
child: state != ScrollState.top
|
||||
? Tooltip(
|
||||
message: context.localized.scrollToTop,
|
||||
child: IconButton.filled(
|
||||
onPressed: () => scrollController.animateTo(0,
|
||||
duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubic),
|
||||
icon: const Icon(
|
||||
IconsaxPlusLinear.arrow_up,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
),
|
||||
if (!librarySearchResults.selecteMode) ...{
|
||||
IconButton(
|
||||
tooltip: context.localized.sortBy,
|
||||
onPressed: () async {
|
||||
final newOptions = await openSortByDialogue(
|
||||
context,
|
||||
libraryProvider: libraryProvider,
|
||||
uniqueKey: uniqueKey,
|
||||
options: (librarySearchResults.filters.sortingOption, librarySearchResults.filters.sortOrder),
|
||||
);
|
||||
if (newOptions != null) {
|
||||
if (newOptions.$1 != null) {
|
||||
libraryProvider.setSortBy(newOptions.$1!);
|
||||
}
|
||||
if (newOptions.$2 != null) {
|
||||
libraryProvider.setSortOrder(newOptions.$2!);
|
||||
}
|
||||
}
|
||||
},
|
||||
icon: const Icon(IconsaxPlusLinear.sort),
|
||||
),
|
||||
if (librarySearchResults.hasActiveFilters) ...{
|
||||
IconButton(
|
||||
tooltip: context.localized.disableFilters,
|
||||
onPressed: disableFilters(librarySearchResults, libraryProvider),
|
||||
icon: const Icon(IconsaxPlusLinear.filter_remove),
|
||||
),
|
||||
},
|
||||
},
|
||||
IconButton(
|
||||
onPressed: () => libraryProvider.toggleSelectMode(),
|
||||
color: librarySearchResults.selecteMode ? Theme.of(context).colorScheme.primary : null,
|
||||
icon: const Icon(IconsaxPlusLinear.category_2),
|
||||
),
|
||||
AnimatedFadeSize(
|
||||
child: librarySearchResults.selecteMode
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(16)),
|
||||
child: Row(
|
||||
spacing: 6,
|
||||
children: [
|
||||
Tooltip(
|
||||
message: context.localized.selectAll,
|
||||
child: IconButton(
|
||||
onPressed: () => libraryProvider.selectAll(true),
|
||||
icon: const Icon(IconsaxPlusLinear.box_add),
|
||||
),
|
||||
),
|
||||
Tooltip(
|
||||
message: context.localized.clearSelection,
|
||||
child: IconButton(
|
||||
onPressed: () => libraryProvider.selectAll(false),
|
||||
icon: const Icon(IconsaxPlusLinear.box_remove),
|
||||
),
|
||||
),
|
||||
if (librarySearchResults.selectedPosters.isNotEmpty) ...{
|
||||
if (AdaptiveLayout.of(context).isDesktop)
|
||||
PopupMenuButton(
|
||||
itemBuilder: (context) => actions.popupMenuItems(useIcons: true),
|
||||
)
|
||||
else
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showBottomSheetPill(
|
||||
context: context,
|
||||
content: (context, scrollController) => ListView(
|
||||
shrinkWrap: true,
|
||||
controller: scrollController,
|
||||
children: actions.listTileItems(context, useIcons: true),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(IconsaxPlusLinear.more))
|
||||
},
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
const Spacer(),
|
||||
if (librarySearchResults.activePosters.isNotEmpty)
|
||||
IconButton.filledTonal(
|
||||
tooltip: context.localized.random,
|
||||
onPressed: () => libraryProvider.openRandom(context),
|
||||
icon: const Icon(
|
||||
IconsaxPlusBold.arrow_up_1,
|
||||
),
|
||||
),
|
||||
if (librarySearchResults.activePosters.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: context.localized.shuffleVideos,
|
||||
onPressed: () async {
|
||||
if (librarySearchResults.showGalleryButtons && !librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.viewGallery(context, shuffle: true);
|
||||
return;
|
||||
} else if (!librarySearchResults.showGalleryButtons && librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.playLibraryItems(context, ref, shuffle: true);
|
||||
return;
|
||||
}
|
||||
|
||||
await showLibraryPlayOptions(
|
||||
context,
|
||||
context.localized.libraryShuffleAndPlayItems,
|
||||
playVideos: librarySearchResults.showPlayButtons
|
||||
? () => libraryProvider.playLibraryItems(context, ref, shuffle: true)
|
||||
: null,
|
||||
viewGallery: librarySearchResults.showGalleryButtons
|
||||
? () => libraryProvider.viewGallery(context, shuffle: true)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
icon: const Icon(IconsaxPlusLinear.shuffle),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (!librarySearchResults.selecteMode) ...{
|
||||
IconButton(
|
||||
tooltip: context.localized.sortBy,
|
||||
onPressed: () async {
|
||||
final newOptions = await openSortByDialogue(
|
||||
context,
|
||||
libraryProvider: libraryProvider,
|
||||
uniqueKey: uniqueKey,
|
||||
options: (librarySearchResults.filters.sortingOption, librarySearchResults.filters.sortOrder),
|
||||
);
|
||||
if (newOptions != null) {
|
||||
if (newOptions.$1 != null) {
|
||||
libraryProvider.setSortBy(newOptions.$1!);
|
||||
}
|
||||
if (newOptions.$2 != null) {
|
||||
libraryProvider.setSortOrder(newOptions.$2!);
|
||||
}
|
||||
}
|
||||
},
|
||||
icon: const Icon(IconsaxPlusLinear.sort),
|
||||
),
|
||||
if (librarySearchResults.hasActiveFilters) ...{
|
||||
IconButton(
|
||||
tooltip: context.localized.disableFilters,
|
||||
onPressed: disableFilters(librarySearchResults, libraryProvider),
|
||||
icon: const Icon(IconsaxPlusLinear.filter_remove),
|
||||
),
|
||||
},
|
||||
},
|
||||
IconButton(
|
||||
onPressed: () => libraryProvider.toggleSelectMode(),
|
||||
color: librarySearchResults.selecteMode ? Theme.of(context).colorScheme.primary : null,
|
||||
icon: const Icon(IconsaxPlusLinear.category_2),
|
||||
),
|
||||
AnimatedFadeSize(
|
||||
child: librarySearchResults.selecteMode
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(16)),
|
||||
child: Row(
|
||||
spacing: 6,
|
||||
children: [
|
||||
Tooltip(
|
||||
message: context.localized.selectAll,
|
||||
child: IconButton(
|
||||
onPressed: () => libraryProvider.selectAll(true),
|
||||
icon: const Icon(IconsaxPlusLinear.box_add),
|
||||
),
|
||||
),
|
||||
Tooltip(
|
||||
message: context.localized.clearSelection,
|
||||
child: IconButton(
|
||||
onPressed: () => libraryProvider.selectAll(false),
|
||||
icon: const Icon(IconsaxPlusLinear.box_remove),
|
||||
),
|
||||
),
|
||||
if (librarySearchResults.selectedPosters.isNotEmpty) ...{
|
||||
if (AdaptiveLayout.of(context).isDesktop)
|
||||
PopupMenuButton(
|
||||
itemBuilder: (context) => actions.popupMenuItems(useIcons: true),
|
||||
)
|
||||
else
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showBottomSheetPill(
|
||||
context: context,
|
||||
content: (context, scrollController) => ListView(
|
||||
shrinkWrap: true,
|
||||
controller: scrollController,
|
||||
children: actions.listTileItems(context, useIcons: true),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(IconsaxPlusLinear.more))
|
||||
},
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
if (!isDPadBar) const Spacer(),
|
||||
if (librarySearchResults.activePosters.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: context.localized.random,
|
||||
onPressed: () => libraryProvider.openRandom(context),
|
||||
icon: const Icon(
|
||||
IconsaxPlusBold.slider_vertical,
|
||||
),
|
||||
),
|
||||
if (librarySearchResults.activePosters.isNotEmpty)
|
||||
IconButton(
|
||||
tooltip: context.localized.shuffleVideos,
|
||||
onPressed: () async {
|
||||
if (librarySearchResults.showGalleryButtons && !librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.viewGallery(context, shuffle: true);
|
||||
return;
|
||||
} else if (!librarySearchResults.showGalleryButtons && librarySearchResults.showPlayButtons) {
|
||||
libraryProvider.playLibraryItems(context, ref, shuffle: true);
|
||||
return;
|
||||
}
|
||||
|
||||
await showLibraryPlayOptions(
|
||||
context,
|
||||
context.localized.libraryShuffleAndPlayItems,
|
||||
playVideos: librarySearchResults.showPlayButtons
|
||||
? () => libraryProvider.playLibraryItems(context, ref, shuffle: true)
|
||||
: null,
|
||||
viewGallery: librarySearchResults.showGalleryButtons
|
||||
? () => libraryProvider.viewGallery(context, shuffle: true)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
icon: const Icon(IconsaxPlusLinear.shuffle),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (isDPadBar) {
|
||||
return content;
|
||||
}
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(left: paddingOf.left, right: paddingOf.right),
|
||||
child: NestedBottomAppBar(
|
||||
child: content,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class LoginUserGrid extends ConsumerWidget {
|
|||
child: FocusButton(
|
||||
onTap: () => editMode ? onLongPress?.call(user) : onPressed?.call(user),
|
||||
onLongPress: switch (AdaptiveLayout.inputDeviceOf(context)) {
|
||||
InputDevice.dpad || InputDevice.pointer => () => onLongPress?.call(user),
|
||||
InputDevice.dPad || InputDevice.pointer => () => onLongPress?.call(user),
|
||||
InputDevice.touch => null,
|
||||
},
|
||||
darkOverlay: false,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/models/account_model.dart';
|
||||
import 'package:fladder/screens/shared/flat_button.dart';
|
||||
import 'package:fladder/screens/shared/user_icon.dart';
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class LoginIcon extends ConsumerWidget {
|
||||
final AccountModel user;
|
||||
|
|
@ -24,7 +26,6 @@ class LoginIcon extends ConsumerWidget {
|
|||
aspectRatio: 1.0,
|
||||
child: Card(
|
||||
elevation: 1,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
child: Stack(
|
||||
children: [
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ Future<ItemBaseModel?> showEditItemPopup(
|
|||
itemUpdated: (newItem) => updatedItem = newItem,
|
||||
refreshOnClose: (refresh) => shouldRefresh = refresh,
|
||||
);
|
||||
return AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
|
||||
return AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer
|
||||
? Dialog(
|
||||
insetPadding: const EdgeInsets.all(64),
|
||||
child: editWidget(),
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class _RefreshPopupDialogState extends ConsumerState<RefreshPopupDialog> {
|
|||
color: Theme.of(context).colorScheme.surface,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer ? 700 : double.infinity),
|
||||
maxWidth: AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer ? 700 : double.infinity),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
|
|
|||
|
|
@ -138,12 +138,6 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
icon: deviceIcon,
|
||||
onTap: () => navigateTo(const ClientSettingsRoute()),
|
||||
),
|
||||
if (quickConnectAvailable)
|
||||
SettingsListTile(
|
||||
label: Text(context.localized.settingsQuickConnectTitle),
|
||||
icon: IconsaxPlusLinear.password_check,
|
||||
onTap: () => openQuickConnectDialog(context),
|
||||
),
|
||||
SettingsListTile(
|
||||
label: Text(context.localized.settingsProfileTitle),
|
||||
subLabel: Text(context.localized.settingsProfileDesc),
|
||||
|
|
@ -203,6 +197,12 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
widthFactor: 0.25,
|
||||
child: Divider(),
|
||||
),
|
||||
if (quickConnectAvailable)
|
||||
SettingsListTile(
|
||||
label: Text(context.localized.settingsQuickConnectTitle),
|
||||
icon: IconsaxPlusLinear.password_check,
|
||||
onTap: () => openQuickConnectDialog(context),
|
||||
),
|
||||
SettingsListTile(
|
||||
label: Text(context.localized.switchUser),
|
||||
icon: IconsaxPlusLinear.arrow_swap_horizontal,
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
|
|||
),
|
||||
FlatButton(
|
||||
onTap: () => widget.items[index].navigateTo(context),
|
||||
onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
|
||||
onLongPress: AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer
|
||||
? null
|
||||
: () {
|
||||
final poster = widget.items[index];
|
||||
|
|
@ -141,7 +141,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
|
|||
),
|
||||
);
|
||||
},
|
||||
onSecondaryTapDown: AdaptiveLayout.of(context).inputDevice == InputDevice.touch
|
||||
onSecondaryTapDown: AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch
|
||||
? null
|
||||
: (details) async {
|
||||
Offset localPosition = details.globalPosition;
|
||||
|
|
@ -175,7 +175,7 @@ class _CarouselBannerState extends ConsumerState<CarouselBanner> {
|
|||
)
|
||||
],
|
||||
),
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer)
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer)
|
||||
AnimatedOpacity(
|
||||
duration: const Duration(milliseconds: 250),
|
||||
opacity: showControls ? 1 : 0,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:iconsax_plus/iconsax_plus.dart';
|
||||
|
||||
import 'package:fladder/models/items/chapters_model.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
|
|
@ -24,7 +25,7 @@ class ChapterRow extends ConsumerWidget {
|
|||
label: context.localized.chapter(chapters.length),
|
||||
height: AdaptiveLayout.poster(context).size / 1.75,
|
||||
items: chapters,
|
||||
itemBuilder: (context, index, selected) {
|
||||
itemBuilder: (context, index) {
|
||||
final chapter = chapters[index];
|
||||
List<ItemAction> generateActions() {
|
||||
return [
|
||||
|
|
@ -58,35 +59,38 @@ class ChapterRow extends ConsumerWidget {
|
|||
},
|
||||
);
|
||||
},
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.75,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: chapter.imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shadowColor: Colors.transparent,
|
||||
color: Theme.of(context).cardColor.withValues(alpha: 0.4),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Text(
|
||||
"${chapter.name} \n${chapter.startPosition.humanize ?? context.localized.start}",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.bold),
|
||||
child: Card(
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.75,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: chapter.imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => const Icon(IconsaxPlusBold.image),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Card(
|
||||
elevation: 0,
|
||||
shadowColor: Colors.transparent,
|
||||
color: Theme.of(context).cardColor.withValues(alpha: 0.4),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Text(
|
||||
"${chapter.name} \n${chapter.startPosition.humanize ?? context.localized.start}",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
overlays: [
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:iconsax_plus/iconsax_plus.dart';
|
||||
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/providers/arguments_provider.dart';
|
||||
import 'package:fladder/screens/shared/animated_fade_size.dart';
|
||||
import 'package:fladder/theme.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
import 'package:fladder/widgets/shared/ensure_visible.dart';
|
||||
|
||||
class MediaPlayButton extends ConsumerWidget {
|
||||
|
|
@ -24,7 +24,19 @@ class MediaPlayButton extends ConsumerWidget {
|
|||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final progress = (item?.progress ?? 0) / 100.0;
|
||||
final radius = FladderTheme.defaultShape.borderRadius;
|
||||
final padding = 3.0;
|
||||
final radius = FladderTheme.smallShape.borderRadius.subtract(BorderRadius.circular(padding));
|
||||
final buttonState = WidgetStateProperty.resolveWith(
|
||||
(states) {
|
||||
return BorderSide(
|
||||
width: 2,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onPrimaryContainer
|
||||
.withValues(alpha: states.contains(WidgetState.focused) ? 0.9 : 0.0),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Widget buttonTitle(Color contentColor) {
|
||||
return Padding(
|
||||
|
|
@ -61,9 +73,10 @@ class MediaPlayButton extends ConsumerWidget {
|
|||
: TextButton(
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPressed,
|
||||
autofocus: ref.read(argumentsStateProvider).htpcMode,
|
||||
style: TextButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
autofocus: AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad,
|
||||
style: ButtonStyle(
|
||||
side: buttonState,
|
||||
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
|
||||
),
|
||||
onFocusChange: (value) {
|
||||
if (value) {
|
||||
|
|
@ -73,7 +86,7 @@ class MediaPlayButton extends ConsumerWidget {
|
|||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
padding: EdgeInsets.all(padding),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
|
@ -81,20 +94,13 @@ class MediaPlayButton extends ConsumerWidget {
|
|||
Positioned.fill(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
blurRadius: 8.0,
|
||||
offset: const Offset(0, 2),
|
||||
color: Colors.black.withValues(alpha: 0.3),
|
||||
)
|
||||
],
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: radius,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Button content
|
||||
buttonTitle(Theme.of(context).colorScheme.primary),
|
||||
buttonTitle(Theme.of(context).colorScheme.onPrimaryContainer),
|
||||
Positioned.fill(
|
||||
child: ClipRect(
|
||||
clipper: _ProgressClipper(
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/screens/details_screens/components/overview_header.dart';
|
||||
import 'package:fladder/screens/shared/media/poster_row.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
import 'package:fladder/util/fladder_image.dart';
|
||||
import 'package:fladder/util/focus_provider.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/widgets/shared/custom_shader_mask.dart';
|
||||
import 'package:fladder/widgets/shared/ensure_visible.dart';
|
||||
|
||||
class DetailedBanner extends ConsumerStatefulWidget {
|
||||
|
|
@ -29,122 +31,81 @@ class _DetailedBannerState extends ConsumerState<DetailedBanner> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final size = MediaQuery.sizeOf(context);
|
||||
final color = Theme.of(context).colorScheme.surface;
|
||||
final stops = [0.05, 0.35, 0.65, 0.95];
|
||||
return Column(
|
||||
final phoneOffsetHeight =
|
||||
AdaptiveLayout.viewSizeOf(context) <= ViewSize.phone ? MediaQuery.paddingOf(context).top + 80 : 0.0;
|
||||
return Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: size.height * 0.50,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
color.withValues(alpha: 0.85),
|
||||
color.withValues(alpha: 0.75),
|
||||
color.withValues(alpha: 0),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
ExcludeFocus(
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Transform.translate(
|
||||
offset: Offset(0, -phoneOffsetHeight),
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.85,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.8,
|
||||
child: CustomShaderMask(
|
||||
child: FladderImage(
|
||||
image: selectedPoster.images?.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ExcludeFocus(
|
||||
child: Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.7,
|
||||
child: ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: [
|
||||
Colors.white,
|
||||
Colors.white,
|
||||
Colors.white,
|
||||
Colors.white.withAlpha(0),
|
||||
],
|
||||
stops: stops,
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
).createShader(bounds);
|
||||
},
|
||||
child: ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return LinearGradient(
|
||||
colors: [
|
||||
Colors.white.withAlpha(0),
|
||||
Colors.white,
|
||||
Colors.white,
|
||||
Colors.white,
|
||||
],
|
||||
stops: stops,
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
).createShader(bounds);
|
||||
},
|
||||
child: FladderImage(
|
||||
image: selectedPoster.images?.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.5,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
spacing: 16,
|
||||
children: [
|
||||
Flexible(
|
||||
child: OverviewHeader(
|
||||
name: selectedPoster.parentBaseModel.name,
|
||||
subTitle: selectedPoster.label(context),
|
||||
image: selectedPoster.getPosters,
|
||||
logoAlignment: Alignment.centerLeft,
|
||||
summary: selectedPoster.overview.summary,
|
||||
productionYear: selectedPoster.overview.productionYear,
|
||||
runTime: selectedPoster.overview.runTime,
|
||||
genres: selectedPoster.overview.genreItems,
|
||||
studios: selectedPoster.overview.studios,
|
||||
officialRating: selectedPoster.overview.parentalRating,
|
||||
communityRating: selectedPoster.overview.communityRating,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: size.height * 0.05,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
FocusProvider(
|
||||
autoFocus: true,
|
||||
child: PosterRow(
|
||||
key: const Key("detailed-banner-row"),
|
||||
primaryPosters: true,
|
||||
label: context.localized.nextUp,
|
||||
posters: widget.posters,
|
||||
onFocused: (poster) {
|
||||
context.ensureVisible(
|
||||
alignment: 1.0,
|
||||
);
|
||||
setState(() {
|
||||
selectedPoster = poster;
|
||||
});
|
||||
widget.onSelect(poster);
|
||||
},
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: size.height * 0.85,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16).copyWith(bottom: 4),
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: AdaptiveLayout.viewSizeOf(context) <= ViewSize.phone ? 1.0 : 0.55,
|
||||
child: OverviewHeader(
|
||||
name: selectedPoster.parentBaseModel.name,
|
||||
subTitle: selectedPoster.label(context),
|
||||
image: selectedPoster.getPosters,
|
||||
logoAlignment: AdaptiveLayout.viewSizeOf(context) <= ViewSize.phone
|
||||
? Alignment.center
|
||||
: Alignment.centerLeft,
|
||||
summary: selectedPoster.overview.summary,
|
||||
productionYear: selectedPoster.overview.productionYear,
|
||||
runTime: selectedPoster.overview.runTime,
|
||||
genres: selectedPoster.overview.genreItems,
|
||||
studios: selectedPoster.overview.studios,
|
||||
officialRating: selectedPoster.overview.parentalRating,
|
||||
communityRating: selectedPoster.overview.communityRating,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
FocusProvider(
|
||||
autoFocus: true,
|
||||
child: PosterRow(
|
||||
primaryPosters: true,
|
||||
label: context.localized.nextUp,
|
||||
posters: widget.posters,
|
||||
onFocused: (poster) {
|
||||
context.ensureVisible(
|
||||
alignment: 1.0,
|
||||
);
|
||||
setState(() {
|
||||
selectedPoster = poster;
|
||||
});
|
||||
widget.onSelect(poster);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import 'package:fladder/util/fladder_image.dart';
|
|||
import 'package:fladder/util/focus_provider.dart';
|
||||
import 'package:fladder/util/item_base_model/item_base_model_extensions.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/refresh_state.dart';
|
||||
import 'package:fladder/widgets/shared/clickable_text.dart';
|
||||
import 'package:fladder/widgets/shared/enum_selection.dart';
|
||||
import 'package:fladder/widgets/shared/horizontal_list.dart';
|
||||
|
|
@ -83,7 +84,7 @@ class _EpisodePosterState extends ConsumerState<EpisodePosters> {
|
|||
contentPadding: widget.contentPadding,
|
||||
startIndex: indexOfCurrent,
|
||||
items: episodes,
|
||||
itemBuilder: (context, index, selected) {
|
||||
itemBuilder: (context, index) {
|
||||
final episode = episodes[index];
|
||||
final isCurrentEpisode = index == indexOfCurrent;
|
||||
return EpisodePoster(
|
||||
|
|
@ -101,8 +102,8 @@ class _EpisodePosterState extends ConsumerState<EpisodePosters> {
|
|||
: () {
|
||||
episode.navigateTo(context);
|
||||
},
|
||||
onLongPress: () {
|
||||
showBottomSheetPill(
|
||||
onLongPress: () async {
|
||||
await showBottomSheetPill(
|
||||
context: context,
|
||||
item: episode,
|
||||
content: (context, scrollController) {
|
||||
|
|
@ -115,6 +116,7 @@ class _EpisodePosterState extends ConsumerState<EpisodePosters> {
|
|||
);
|
||||
},
|
||||
);
|
||||
context.refreshData();
|
||||
},
|
||||
actions: episode.generateActions(context, ref),
|
||||
isCurrentEpisode: isCurrentEpisode,
|
||||
|
|
@ -185,7 +187,7 @@ class EpisodePoster extends ConsumerWidget {
|
|||
decodeHeight: 250,
|
||||
),
|
||||
overlays: [
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer && actions.isNotEmpty)
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer && actions.isNotEmpty)
|
||||
ExcludeFocus(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:url_launcher/url_launcher.dart' as urilauncher;
|
|||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
import 'package:fladder/models/items/item_shared_models.dart';
|
||||
import 'package:fladder/providers/arguments_provider.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/sticky_header_text.dart';
|
||||
|
|
@ -19,6 +20,9 @@ class ExternalUrlsRow extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
if (ref.watch(argumentsStateProvider).htpcMode) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class _MediaBannerState extends ConsumerState<MediaBanner> {
|
|||
),
|
||||
child: FocusButton(
|
||||
onTap: () => currentItem.navigateTo(context),
|
||||
onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.touch
|
||||
onLongPress: AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch
|
||||
? () async {
|
||||
interacting = true;
|
||||
final poster = currentItem;
|
||||
|
|
@ -165,7 +165,7 @@ class _MediaBannerState extends ConsumerState<MediaBanner> {
|
|||
timer.reset();
|
||||
}
|
||||
: null,
|
||||
onSecondaryTapDown: AdaptiveLayout.of(context).inputDevice == InputDevice.touch
|
||||
onSecondaryTapDown: AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch
|
||||
? null
|
||||
: (details) async {
|
||||
Offset localPosition = details.globalPosition;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class PeopleRow extends ConsumerWidget {
|
|||
height: AdaptiveLayout.poster(context).size * 0.9,
|
||||
contentPadding: contentPadding,
|
||||
items: people,
|
||||
itemBuilder: (context, index, selected) {
|
||||
itemBuilder: (context, index) {
|
||||
final person = people[index];
|
||||
return AspectRatio(
|
||||
aspectRatio: 0.6,
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ class PosterListItem extends ConsumerWidget {
|
|||
),
|
||||
child: FocusButton(
|
||||
onTap: () => pressedWidget(context),
|
||||
autoFocus:
|
||||
FocusProvider.autoFocusOf(context) && AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad,
|
||||
onFocusChanged: (focus) {
|
||||
if (focus) {
|
||||
context.ensureVisible();
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class PosterRow extends ConsumerWidget {
|
|||
context.ensureVisible();
|
||||
}
|
||||
},
|
||||
itemBuilder: (context, index, selected) {
|
||||
itemBuilder: (context, index) {
|
||||
final poster = posters[index];
|
||||
return PosterWidget(
|
||||
key: Key(poster.id),
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:iconsax_plus/iconsax_plus.dart';
|
||||
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
import 'package:fladder/models/items/item_shared_models.dart';
|
||||
import 'package:fladder/screens/shared/media/components/poster_image.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
import 'package:fladder/util/focus_provider.dart';
|
||||
import 'package:fladder/util/item_base_model/item_base_model_extensions.dart';
|
||||
import 'package:fladder/util/item_base_model/play_item_helpers.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/widgets/shared/clickable_text.dart';
|
||||
import 'package:fladder/widgets/shared/item_actions.dart';
|
||||
|
||||
|
|
@ -138,3 +141,56 @@ class PosterWidget extends ConsumerWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PosterPlaceHolder extends StatelessWidget {
|
||||
final Function() onTap;
|
||||
final double aspectRatio;
|
||||
const PosterPlaceHolder({
|
||||
required this.onTap,
|
||||
required this.aspectRatio,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
aspectRatio: aspectRatio,
|
||||
child: FractionallySizedBox(
|
||||
alignment: Alignment.topCenter,
|
||||
heightFactor: 0.85,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: FocusButton(
|
||||
onTap: onTap,
|
||||
child: Card(
|
||||
color: Theme.of(context).colorScheme.surface.withValues(alpha: 0.2),
|
||||
elevation: 0,
|
||||
shadowColor: Colors.transparent,
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 8,
|
||||
children: [
|
||||
const Icon(
|
||||
IconsaxPlusLinear.more_square,
|
||||
size: 46,
|
||||
),
|
||||
Text(
|
||||
context.localized.showMore,
|
||||
style: Theme.of(context).textTheme.labelMedium,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class SeasonsRow extends ConsumerWidget {
|
|||
itemBuilder: (
|
||||
context,
|
||||
index,
|
||||
selected,
|
||||
) {
|
||||
final season = (seasons ?? [])[index];
|
||||
return SeasonPoster(
|
||||
|
|
@ -153,7 +152,7 @@ class SeasonPoster extends ConsumerWidget {
|
|||
items: season.generateActions(context, ref).popupMenuItems(useIcons: true));
|
||||
},
|
||||
onTap: () => onSeasonPressed?.call(season),
|
||||
onLongPress: AdaptiveLayout.of(context).inputDevice == InputDevice.touch
|
||||
onLongPress: AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch
|
||||
? () {
|
||||
showBottomSheetPill(
|
||||
context: context,
|
||||
|
|
@ -166,7 +165,7 @@ class SeasonPoster extends ConsumerWidget {
|
|||
}
|
||||
: null,
|
||||
overlays: [
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer)
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer)
|
||||
ExcludeFocus(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
|
|
|
|||
|
|
@ -31,10 +31,7 @@ class NestedScaffold extends ConsumerWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: body,
|
||||
),
|
||||
child: body,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
|
||||
import 'package:fladder/models/account_model.dart';
|
||||
import 'package:fladder/screens/shared/flat_button.dart';
|
||||
import 'package:fladder/theme.dart';
|
||||
import 'package:fladder/util/string_extensions.dart';
|
||||
|
||||
class UserIcon extends ConsumerWidget {
|
||||
|
|
@ -55,12 +56,15 @@ class UserIcon extends ConsumerWidget {
|
|||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
CachedNetworkImage(
|
||||
imageUrl: user?.avatar ?? "",
|
||||
progressIndicatorBuilder: (context, url, progress) => placeHolder(),
|
||||
errorWidget: (context, url, error) => placeHolder(),
|
||||
memCacheHeight: 128,
|
||||
fit: BoxFit.cover,
|
||||
ClipRRect(
|
||||
borderRadius: FladderTheme.defaultShape.borderRadius,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: user?.avatar ?? "",
|
||||
progressIndicatorBuilder: (context, url, progress) => placeHolder(),
|
||||
errorWidget: (context, url, error) => placeHolder(),
|
||||
memCacheHeight: 128,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
FlatButton(
|
||||
onTap: onTap,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import 'package:fladder/screens/shared/default_alert_dialog.dart';
|
|||
import 'package:fladder/screens/syncing/sync_item_details.dart';
|
||||
import 'package:fladder/screens/syncing/sync_widgets.dart';
|
||||
import 'package:fladder/screens/syncing/widgets/sync_progress_builder.dart';
|
||||
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
||||
import 'package:fladder/util/fladder_image.dart';
|
||||
import 'package:fladder/util/focus_provider.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
|
@ -65,6 +66,7 @@ class SyncListItem extends ConsumerWidget {
|
|||
child: FocusButton(
|
||||
onTap: () => baseItem?.navigateTo(context),
|
||||
onLongPress: () => showSyncItemDetails(context, syncedItem, ref),
|
||||
autoFocus: FocusProvider.autoFocusOf(context) && AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad,
|
||||
child: ExcludeFocus(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/models/items/chapters_model.dart';
|
||||
import 'package:fladder/screens/shared/flat_button.dart';
|
||||
import 'package:fladder/widgets/shared/horizontal_list.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
void showPlayerChapterDialogue(
|
||||
BuildContext context, {
|
||||
|
|
@ -45,7 +47,7 @@ class VideoPlayerChapters extends ConsumerWidget {
|
|||
startIndex: chapters.indexOf(currentChapter ?? chapters.first),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
items: chapters.toList(),
|
||||
itemBuilder: (context, index, selected) {
|
||||
itemBuilder: (context, index) {
|
||||
final chapter = chapters[index];
|
||||
final isCurrent = chapter == currentChapter;
|
||||
return Card(
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class _VideoPlayerNextWrapperState extends ConsumerState<VideoPlayerNextWrapper>
|
|||
}
|
||||
|
||||
Future<void> clearOverlaySettings() async {
|
||||
if (AdaptiveLayout.of(context).inputDevice != InputDevice.pointer) {
|
||||
if (AdaptiveLayout.inputDeviceOf(context) != InputDevice.pointer) {
|
||||
ScreenBrightness().resetApplicationScreenBrightness();
|
||||
} else {
|
||||
fullScreenHelper.closeFullScreen(ref);
|
||||
|
|
|
|||
|
|
@ -95,10 +95,10 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
children: [
|
||||
Positioned.fill(
|
||||
child: GestureDetector(
|
||||
onTap: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
|
||||
onTap: AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer
|
||||
? () => player.playOrPause()
|
||||
: () => toggleOverlay(),
|
||||
onDoubleTap: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
|
||||
onDoubleTap: AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer
|
||||
? () => fullScreenHelper.toggleFullScreen(ref)
|
||||
: null,
|
||||
),
|
||||
|
|
@ -245,7 +245,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
],
|
||||
),
|
||||
),
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.touch)
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch)
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Tooltip(
|
||||
|
|
@ -362,7 +362,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer)
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer)
|
||||
Tooltip(
|
||||
message: context.localized.stop,
|
||||
child: IconButton(
|
||||
|
|
@ -379,7 +379,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
),
|
||||
),
|
||||
},
|
||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer &&
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer &&
|
||||
AdaptiveLayout.viewSizeOf(context) > ViewSize.phone) ...[
|
||||
VideoVolumeSlider(
|
||||
onChanged: () => resetTimer(),
|
||||
|
|
@ -651,7 +651,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
|
||||
Future<void> clearOverlaySettings() async {
|
||||
toggleOverlay(value: true);
|
||||
if (AdaptiveLayout.of(context).inputDevice != InputDevice.pointer) {
|
||||
if (AdaptiveLayout.inputDeviceOf(context) != InputDevice.pointer) {
|
||||
ScreenBrightness().resetApplicationScreenBrightness();
|
||||
} else {
|
||||
disableFullScreen();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue