generated from dellevin/template
代码优化,epub阅读标签
This commit is contained in:
@@ -598,6 +598,8 @@ class _MovieDetailPageState extends State<MovieDetailPage> {
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
_buildStatusTag(movie),
|
||||
const SizedBox(width: 6),
|
||||
_buildCategoryTag(movie),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -679,6 +681,35 @@ class _MovieDetailPageState extends State<MovieDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCategoryTag(Movie movie) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
const labels = {
|
||||
'movie': '电影',
|
||||
'tv': '电视剧',
|
||||
'anime': '动漫',
|
||||
'variety': '综艺',
|
||||
'documentary': '纪录片',
|
||||
'short': '微短剧',
|
||||
};
|
||||
final label = labels[movie.category];
|
||||
if (label == null) return const SizedBox.shrink();
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: colors.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: colors.onSurface.withValues(alpha: 0.5),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDirectorsSection(Movie movie) {
|
||||
final isOverlay = _detailStyle == 1;
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
Reference in New Issue
Block a user