mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-10 16:00:28 -07:00
fix: Videoplayer large logo
This commit is contained in:
parent
b977bfc319
commit
bfa7607681
3 changed files with 28 additions and 22 deletions
|
|
@ -17,8 +17,10 @@ class ItemLogo extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final logo = item.getPosters?.logo;
|
final logo = item.getPosters?.logo;
|
||||||
|
final size = MediaQuery.sizeOf(context);
|
||||||
|
final maxHeight = size.height * 0.45;
|
||||||
final textWidget = Container(
|
final textWidget = Container(
|
||||||
height: 512,
|
height: maxHeight,
|
||||||
alignment: imageAlignment,
|
alignment: imageAlignment,
|
||||||
child: Text(
|
child: Text(
|
||||||
item.parentBaseModel.name,
|
item.parentBaseModel.name,
|
||||||
|
|
@ -33,13 +35,14 @@ class ItemLogo extends StatelessWidget {
|
||||||
);
|
);
|
||||||
return logo != null
|
return logo != null
|
||||||
? ConstrainedBox(
|
? ConstrainedBox(
|
||||||
constraints: const BoxConstraints(maxWidth: 500, maxHeight: 500),
|
constraints: BoxConstraints(maxWidth: size.width * 0.35, maxHeight: maxHeight),
|
||||||
child: FladderImage(
|
child: FladderImage(
|
||||||
image: logo,
|
image: logo,
|
||||||
disableBlur: true,
|
disableBlur: true,
|
||||||
alignment: imageAlignment,
|
stackFit: StackFit.passthrough,
|
||||||
|
alignment: Alignment.bottomLeft,
|
||||||
imageErrorBuilder: (context, object, stack) => textWidget,
|
imageErrorBuilder: (context, object, stack) => textWidget,
|
||||||
placeHolder: const SizedBox(height: 0),
|
placeHolder: textWidget,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,9 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
spacing: 16,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => minimizePlayer(context),
|
onPressed: () => minimizePlayer(context),
|
||||||
|
|
@ -260,26 +261,26 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
||||||
size: 24,
|
size: 24,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
|
||||||
if (currentItem != null)
|
if (currentItem != null)
|
||||||
Expanded(
|
ConstrainedBox(
|
||||||
child: ConstrainedBox(
|
constraints: BoxConstraints(
|
||||||
constraints: BoxConstraints(
|
maxHeight: 150.clamp(50, MediaQuery.sizeOf(context).height * 0.25).toDouble(),
|
||||||
maxHeight: 150.clamp(50, MediaQuery.sizeOf(context).height * 0.25).toDouble(),
|
),
|
||||||
),
|
child: ItemLogo(
|
||||||
child: ItemLogo(
|
item: currentItem,
|
||||||
item: currentItem,
|
imageAlignment: Alignment.topLeft,
|
||||||
imageAlignment: Alignment.topLeft,
|
textStyle: Theme.of(context).textTheme.headlineLarge,
|
||||||
textStyle: Theme.of(context).textTheme.headlineLarge,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const Spacer(),
|
||||||
if (AdaptiveLayout.of(context).inputDevice == InputDevice.touch)
|
if (AdaptiveLayout.of(context).inputDevice == InputDevice.touch)
|
||||||
Tooltip(
|
Align(
|
||||||
message: context.localized.stop,
|
alignment: Alignment.centerRight,
|
||||||
child: IconButton(
|
child: Tooltip(
|
||||||
onPressed: () => closePlayer(), icon: const Icon(IconsaxPlusLinear.close_square))),
|
message: context.localized.stop,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () => closePlayer(), icon: const Icon(IconsaxPlusLinear.close_square))),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ class FladderImage extends ConsumerWidget {
|
||||||
final Widget Function(BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded)? frameBuilder;
|
final Widget Function(BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded)? frameBuilder;
|
||||||
final Widget Function(BuildContext context, Object object, StackTrace? stack)? imageErrorBuilder;
|
final Widget Function(BuildContext context, Object object, StackTrace? stack)? imageErrorBuilder;
|
||||||
final Widget? placeHolder;
|
final Widget? placeHolder;
|
||||||
|
final StackFit stackFit;
|
||||||
final BoxFit fit;
|
final BoxFit fit;
|
||||||
final BoxFit? blurFit;
|
final BoxFit? blurFit;
|
||||||
final AlignmentGeometry? alignment;
|
final AlignmentGeometry? alignment;
|
||||||
|
|
@ -22,6 +23,7 @@ class FladderImage extends ConsumerWidget {
|
||||||
this.frameBuilder,
|
this.frameBuilder,
|
||||||
this.imageErrorBuilder,
|
this.imageErrorBuilder,
|
||||||
this.placeHolder,
|
this.placeHolder,
|
||||||
|
this.stackFit = StackFit.expand,
|
||||||
this.fit = BoxFit.cover,
|
this.fit = BoxFit.cover,
|
||||||
this.blurFit,
|
this.blurFit,
|
||||||
this.alignment,
|
this.alignment,
|
||||||
|
|
@ -39,7 +41,7 @@ class FladderImage extends ConsumerWidget {
|
||||||
} else {
|
} else {
|
||||||
return Stack(
|
return Stack(
|
||||||
key: Key(newImage.key),
|
key: Key(newImage.key),
|
||||||
fit: StackFit.expand,
|
fit: stackFit,
|
||||||
children: [
|
children: [
|
||||||
if (!disableBlur && useBluredPlaceHolder && newImage.hash.isNotEmpty || blurOnly)
|
if (!disableBlur && useBluredPlaceHolder && newImage.hash.isNotEmpty || blurOnly)
|
||||||
BlurHash(
|
BlurHash(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue