fix: 'Watching with' should only show up for anime
This commit is contained in:
@@ -359,71 +359,71 @@ class DetailsPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),*/
|
),*/
|
||||||
Padding(
|
if (state.trackingType == TrackingMediumType.anime)
|
||||||
padding: const EdgeInsetsGeometry.symmetric(
|
Padding(
|
||||||
vertical: 8,
|
padding: const EdgeInsetsGeometry.symmetric(
|
||||||
horizontal: 8,
|
vertical: 8,
|
||||||
),
|
horizontal: 8,
|
||||||
child: Column(
|
),
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.only(
|
Padding(
|
||||||
bottom: 8,
|
padding: const EdgeInsets.only(
|
||||||
),
|
bottom: 8,
|
||||||
child: Row(
|
),
|
||||||
children: [
|
child: Row(
|
||||||
Text(
|
children: [
|
||||||
t.details.watchingWith.title,
|
Text(
|
||||||
style: Theme.of(
|
t.details.watchingWith.title,
|
||||||
context,
|
style: Theme.of(
|
||||||
).textTheme.titleSmall,
|
context,
|
||||||
),
|
).textTheme.titleSmall,
|
||||||
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsGeometry.only(
|
|
||||||
left: 4,
|
|
||||||
),
|
),
|
||||||
child: IconButton(
|
|
||||||
onPressed: () async {
|
|
||||||
final bloc = context
|
|
||||||
.read<DetailsBloc>();
|
|
||||||
final watchers = await bloc
|
|
||||||
.getAllAnimeWatchers();
|
|
||||||
final result =
|
|
||||||
await showModalBottomSheet<
|
|
||||||
AnimeWatcher?
|
|
||||||
>(
|
|
||||||
context: context,
|
|
||||||
builder: (ctx) =>
|
|
||||||
DetailsWatcherSheet(
|
|
||||||
watchers: watchers,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
if (result == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do not allow adding a watcher twice.
|
Padding(
|
||||||
if (state.animeWatchers.any(
|
padding: const EdgeInsetsGeometry.only(
|
||||||
(watcher) =>
|
left: 4,
|
||||||
watcher.name == result.name,
|
),
|
||||||
)) {
|
child: IconButton(
|
||||||
return;
|
onPressed: () async {
|
||||||
}
|
final bloc = context
|
||||||
|
.read<DetailsBloc>();
|
||||||
|
final watchers = await bloc
|
||||||
|
.getAllAnimeWatchers();
|
||||||
|
final result =
|
||||||
|
await showModalBottomSheet<
|
||||||
|
AnimeWatcher?
|
||||||
|
>(
|
||||||
|
context: context,
|
||||||
|
builder: (ctx) =>
|
||||||
|
DetailsWatcherSheet(
|
||||||
|
watchers: watchers,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (result == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context.read<DetailsBloc>().add(
|
// Do not allow adding a watcher twice.
|
||||||
AnimeWatcherAddedEvent(result),
|
if (state.animeWatchers.any(
|
||||||
);
|
(watcher) =>
|
||||||
},
|
watcher.name == result.name,
|
||||||
icon: const Icon(Icons.add),
|
)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context.read<DetailsBloc>().add(
|
||||||
|
AnimeWatcherAddedEvent(result),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.add),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
if (state.trackingType == TrackingMediumType.anime)
|
|
||||||
if (state.animeWatchers.isNotEmpty)
|
if (state.animeWatchers.isNotEmpty)
|
||||||
Wrap(
|
Wrap(
|
||||||
children: [
|
children: [
|
||||||
@@ -446,9 +446,9 @@ class DetailsPage extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
else
|
else
|
||||||
Text(t.details.watchingWith.alone),
|
Text(t.details.watchingWith.alone),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 8,
|
vertical: 8,
|
||||||
|
|||||||
Reference in New Issue
Block a user