- Drama 新增 coverLandscape,WatchProgress 新增 dramaCoverLandscape - 继续观看横幅优先使用横版封面,缺省回退竖版 - 底部导航栏图标与文字间距由 5dp 收紧至 1dp
This commit is contained in:
1 parent
3590cd0c55
commit
26321e3348
8 files changed
+64
-12
No files matched your search
@@ -97,6 +97,7 @@ class Drama {
|
||||
required this.title,
|
||||
required this.synopsis,
|
||||
required this.posterUrl,
|
||||
this.coverLandscape = '',
|
||||
this.episodes = const [],
|
||||
this.titleLocales = const {},
|
||||
this.synopsisLocales = const {},
|
||||
@@ -133,6 +134,9 @@ class Drama {
|
||||
final String tagCode;
|
||||
final String tagColor;
|
||||
final String posterUrl;
|
||||
|
||||
/// 横版封面,用于继续观看横幅等横向展示位;为空时回退竖版 `posterUrl`。
|
||||
final String coverLandscape;
|
||||
final List<Episode> episodes;
|
||||
final String category;
|
||||
final Map<String, String> categoryLocales;
|
||||
@@ -179,6 +183,7 @@ class Drama {
|
||||
tagCode: (json['tagCode'] as String? ?? '').trim(),
|
||||
tagColor: json['tagColor'] as String? ?? '',
|
||||
posterUrl: json['cover'] as String? ?? '',
|
||||
coverLandscape: json['coverLandscape'] as String? ?? '',
|
||||
episodes: preview is Map<String, dynamic>
|
||||
? [Episode.fromJson(preview)]
|
||||
: const [],
|
||||
@@ -212,6 +217,7 @@ class Drama {
|
||||
tagCode: (json['tagCode'] as String? ?? '').trim(),
|
||||
tagColor: json['tagColor'] as String? ?? '',
|
||||
posterUrl: json['cover'] as String? ?? '',
|
||||
coverLandscape: json['coverLandscape'] as String? ?? '',
|
||||
category: text.category,
|
||||
categoryLocales: text.categoryLocales,
|
||||
types: text.types,
|
||||
|
||||
@@ -16,6 +16,7 @@ class WatchProgress {
|
||||
this.dramaTitle,
|
||||
this.titleLocales = const {},
|
||||
this.dramaCover,
|
||||
this.dramaCoverLandscape,
|
||||
this.episodeNumber,
|
||||
this.totalEpisodes,
|
||||
this.finished = false,
|
||||
@@ -29,6 +30,9 @@ class WatchProgress {
|
||||
final String? dramaTitle;
|
||||
final Map<String, String> titleLocales;
|
||||
final String? dramaCover;
|
||||
|
||||
/// 横版封面,用于继续观看横幅等横向位;为空时回退 [dramaCover]。
|
||||
final String? dramaCoverLandscape;
|
||||
final int? episodeNumber;
|
||||
final int? totalEpisodes;
|
||||
final Duration position;
|
||||
@@ -60,6 +64,7 @@ class WatchProgress {
|
||||
dramaTitle: json['dramaTitle']?.toString(),
|
||||
titleLocales: localeMap(json['titleLocales']),
|
||||
dramaCover: json['dramaCover']?.toString(),
|
||||
dramaCoverLandscape: json['dramaCoverLandscape']?.toString(),
|
||||
episodeNumber: json['episodeNumber'] == null
|
||||
? null
|
||||
: jsonToInt(json['episodeNumber']),
|
||||
@@ -83,6 +88,7 @@ class WatchProgress {
|
||||
if (dramaTitle != null) 'dramaTitle': dramaTitle,
|
||||
if (titleLocales.isNotEmpty) 'titleLocales': titleLocales,
|
||||
if (dramaCover != null) 'dramaCover': dramaCover,
|
||||
if (dramaCoverLandscape != null) 'dramaCoverLandscape': dramaCoverLandscape,
|
||||
if (episodeNumber != null) 'episodeNumber': episodeNumber,
|
||||
if (totalEpisodes != null) 'totalEpisodes': totalEpisodes,
|
||||
'positionMs': position.inMilliseconds,
|
||||
|
||||
@@ -46,6 +46,14 @@ class WatchRecord {
|
||||
return pageCover.isNotEmpty ? pageCover : drama?.posterUrl ?? '';
|
||||
}
|
||||
|
||||
/// 横向展示位(继续观看横幅)优先用横版封面,缺省回退竖版。
|
||||
String get displayLandscapeCover {
|
||||
final pageLandscape = progress.dramaCoverLandscape?.trim() ?? '';
|
||||
if (pageLandscape.isNotEmpty) return pageLandscape;
|
||||
final landscape = drama?.coverLandscape.trim() ?? '';
|
||||
return landscape.isNotEmpty ? landscape : displayCover;
|
||||
}
|
||||
|
||||
/// 分页接口已带展示字段时无需等待详情加载。
|
||||
bool get hasDisplayMetadata =>
|
||||
displayTitle.isNotEmpty ||
|
||||
|
||||
@@ -37,7 +37,7 @@ abstract final class AppDimens {
|
||||
static const double previewSectionTitle = 14;
|
||||
static const double chipFont = 10;
|
||||
static const double navLabel = 13;
|
||||
static const double navLabelGap = 5;
|
||||
static const double navLabelGap = 1;
|
||||
|
||||
static const double buttonHeight = 48;
|
||||
static const double primaryButtonHeight = 52;
|
||||
|
||||
Reference in new issue
Block a user