mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
feat: Improve how unsupported items are shown. (#129)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
85e5d34738
commit
e50d666fa9
12 changed files with 213 additions and 41 deletions
|
|
@ -9,6 +9,7 @@ import 'package:fladder/models/items/item_shared_models.dart';
|
|||
import 'package:fladder/models/items/photos_model.dart';
|
||||
import 'package:fladder/models/items/series_model.dart';
|
||||
import 'package:fladder/screens/shared/flat_button.dart';
|
||||
import 'package:fladder/screens/shared/media/components/poster_placeholder.dart';
|
||||
import 'package:fladder/theme.dart';
|
||||
import 'package:fladder/util/adaptive_layout.dart';
|
||||
import 'package:fladder/util/disable_keypad_focus.dart';
|
||||
|
|
@ -57,12 +58,6 @@ class _PosterImageState extends ConsumerState<PosterImage> {
|
|||
late String currentTag = widget.heroTag == true ? widget.poster.id : UniqueKey().toString();
|
||||
bool hover = false;
|
||||
|
||||
Widget get placeHolder {
|
||||
return Center(
|
||||
child: Icon(widget.poster.type.icon),
|
||||
);
|
||||
}
|
||||
|
||||
void pressedWidget() async {
|
||||
if (widget.heroTag == false) {
|
||||
setState(() {
|
||||
|
|
@ -113,7 +108,7 @@ class _PosterImageState extends ConsumerState<PosterImage> {
|
|||
children: [
|
||||
FladderImage(
|
||||
image: widget.poster.getPosters?.primary ?? widget.poster.getPosters?.backDrop?.lastOrNull,
|
||||
placeHolder: placeHolder,
|
||||
placeHolder: PosterPlaceholder(item: widget.poster),
|
||||
),
|
||||
if (poster.userData.progress > 0 && widget.poster.type == FladderItemType.book)
|
||||
Align(
|
||||
|
|
|
|||
55
lib/screens/shared/media/components/poster_placeholder.dart
Normal file
55
lib/screens/shared/media/components/poster_placeholder.dart
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fladder/models/item_base_model.dart';
|
||||
|
||||
class PosterPlaceholder extends StatelessWidget {
|
||||
final ItemBaseModel item;
|
||||
const PosterPlaceholder({required this.item, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Opacity(opacity: 0.5, child: Icon(item.type.icon)),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.title,
|
||||
maxLines: 2,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
softWrap: true,
|
||||
),
|
||||
if (item.label(context) != null) ...[
|
||||
Opacity(
|
||||
opacity: 0.75,
|
||||
child: Text(
|
||||
item.label(context)!,
|
||||
maxLines: 2,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
softWrap: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue