mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-13 09:20:31 -07:00
chore: Season posters
This commit is contained in:
parent
be2bad14f1
commit
bbed9cb82b
2 changed files with 16 additions and 12 deletions
|
|
@ -173,7 +173,6 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
|
||||||
SeasonsRow(
|
SeasonsRow(
|
||||||
contentPadding: padding,
|
contentPadding: padding,
|
||||||
seasons: details.seasons,
|
seasons: details.seasons,
|
||||||
onSeasonPressed: (season) => season.navigateTo(context),
|
|
||||||
),
|
),
|
||||||
if (details.overview.people.isNotEmpty)
|
if (details.overview.people.isNotEmpty)
|
||||||
PeopleRow(
|
PeopleRow(
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import 'package:fladder/util/fladder_image.dart';
|
||||||
import 'package:fladder/util/focus_provider.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/item_base_model_extensions.dart';
|
||||||
import 'package:fladder/util/localization_helper.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/clickable_text.dart';
|
||||||
import 'package:fladder/widgets/shared/horizontal_list.dart';
|
import 'package:fladder/widgets/shared/horizontal_list.dart';
|
||||||
import 'package:fladder/widgets/shared/item_actions.dart';
|
import 'package:fladder/widgets/shared/item_actions.dart';
|
||||||
|
|
@ -18,12 +19,10 @@ import 'package:fladder/widgets/shared/status_card.dart';
|
||||||
|
|
||||||
class SeasonsRow extends ConsumerWidget {
|
class SeasonsRow extends ConsumerWidget {
|
||||||
final EdgeInsets contentPadding;
|
final EdgeInsets contentPadding;
|
||||||
final ValueChanged<SeasonModel>? onSeasonPressed;
|
|
||||||
final List<SeasonModel>? seasons;
|
final List<SeasonModel>? seasons;
|
||||||
|
|
||||||
const SeasonsRow({
|
const SeasonsRow({
|
||||||
super.key,
|
super.key,
|
||||||
this.onSeasonPressed,
|
|
||||||
required this.seasons,
|
required this.seasons,
|
||||||
this.contentPadding = const EdgeInsets.symmetric(horizontal: 16),
|
this.contentPadding = const EdgeInsets.symmetric(horizontal: 16),
|
||||||
});
|
});
|
||||||
|
|
@ -42,7 +41,6 @@ class SeasonsRow extends ConsumerWidget {
|
||||||
final season = (seasons ?? [])[index];
|
final season = (seasons ?? [])[index];
|
||||||
return SeasonPoster(
|
return SeasonPoster(
|
||||||
season: season,
|
season: season,
|
||||||
onSeasonPressed: onSeasonPressed,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
@ -51,12 +49,12 @@ class SeasonsRow extends ConsumerWidget {
|
||||||
|
|
||||||
class SeasonPoster extends ConsumerWidget {
|
class SeasonPoster extends ConsumerWidget {
|
||||||
final SeasonModel season;
|
final SeasonModel season;
|
||||||
final ValueChanged<SeasonModel>? onSeasonPressed;
|
|
||||||
|
|
||||||
const SeasonPoster({required this.season, this.onSeasonPressed, super.key});
|
const SeasonPoster({required this.season, super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final myKey = key ?? UniqueKey();
|
||||||
Padding placeHolder(String title) {
|
Padding placeHolder(String title) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
|
|
@ -86,11 +84,14 @@ class SeasonPoster extends ConsumerWidget {
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: FladderImage(
|
child: Hero(
|
||||||
image: season.getPosters?.primary ??
|
tag: myKey,
|
||||||
season.parentImages?.backDrop?.firstOrNull ??
|
child: FladderImage(
|
||||||
season.parentImages?.primary,
|
image: season.getPosters?.primary ??
|
||||||
placeHolder: placeHolder(season.name),
|
season.parentImages?.backDrop?.firstOrNull ??
|
||||||
|
season.parentImages?.primary,
|
||||||
|
placeHolder: placeHolder(season.name),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (season.images?.primary == null)
|
if (season.images?.primary == null)
|
||||||
|
|
@ -151,7 +152,11 @@ class SeasonPoster extends ConsumerWidget {
|
||||||
position: position,
|
position: position,
|
||||||
items: season.generateActions(context, ref).popupMenuItems(useIcons: true));
|
items: season.generateActions(context, ref).popupMenuItems(useIcons: true));
|
||||||
},
|
},
|
||||||
onTap: () => onSeasonPressed?.call(season),
|
onTap: () async {
|
||||||
|
await season.navigateTo(context, ref: ref, tag: myKey);
|
||||||
|
if (!context.mounted) return;
|
||||||
|
context.refreshData();
|
||||||
|
},
|
||||||
onLongPress: AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch
|
onLongPress: AdaptiveLayout.inputDeviceOf(context) == InputDevice.touch
|
||||||
? () {
|
? () {
|
||||||
showBottomSheetPill(
|
showBottomSheetPill(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue