mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-27 05:45:51 +08:00
show video label
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -71,6 +71,18 @@ class MemberCoinLikeItem extends StatelessWidget {
|
|||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
radius: 0,
|
radius: 0,
|
||||||
),
|
),
|
||||||
|
if (item.isCooperation == true)
|
||||||
|
const PBadge(
|
||||||
|
text: '合作',
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
)
|
||||||
|
else if (item.isSteins == true)
|
||||||
|
const PBadge(
|
||||||
|
text: '互动',
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
),
|
||||||
if (item.duration != null && item.duration! > 0)
|
if (item.duration != null && item.duration! > 0)
|
||||||
PBadge(
|
PBadge(
|
||||||
bottom: 6,
|
bottom: 6,
|
||||||
|
|||||||
@@ -99,7 +99,30 @@ class VideoCardVMemberHome extends StatelessWidget {
|
|||||||
size: PBadgeSize.small,
|
size: PBadgeSize.small,
|
||||||
type: PBadgeType.gray,
|
type: PBadgeType.gray,
|
||||||
text: DurationUtil.formatDuration(videoItem.duration),
|
text: DurationUtil.formatDuration(videoItem.duration),
|
||||||
|
),
|
||||||
|
if (videoItem.badges?.isNotEmpty == true)
|
||||||
|
PBadge(
|
||||||
|
text: videoItem.badges!
|
||||||
|
.map((e) => e.text ?? '')
|
||||||
|
.join('|'),
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
type: videoItem.badges!.first.text == '充电专属'
|
||||||
|
? PBadgeType.error
|
||||||
|
: PBadgeType.primary,
|
||||||
)
|
)
|
||||||
|
else if (videoItem.isCooperation == true)
|
||||||
|
const PBadge(
|
||||||
|
text: '合作',
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
)
|
||||||
|
else if (videoItem.isSteins == true)
|
||||||
|
const PBadge(
|
||||||
|
text: '互动',
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -132,6 +132,37 @@ class _VideoInfoState extends State<VideoInfo> {
|
|||||||
|
|
||||||
late final _horizontalMemberPage = Pref.horizontalMemberPage;
|
late final _horizontalMemberPage = Pref.horizontalMemberPage;
|
||||||
|
|
||||||
|
WidgetSpan _labelWidget(String text, Color bgColor, Color textColor) {
|
||||||
|
return WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 4,
|
||||||
|
vertical: 3,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: bgColor,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
textScaler: TextScaler.noScaling,
|
||||||
|
strutStyle: const StrutStyle(
|
||||||
|
leading: 0,
|
||||||
|
height: 1,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
height: 1,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: textColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) {
|
Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) {
|
||||||
late final isDark = theme.brightness == Brightness.dark;
|
late final isDark = theme.brightness == Brightness.dark;
|
||||||
Widget child() => Text.rich(
|
Widget child() => Text.rich(
|
||||||
@@ -171,7 +202,11 @@ class _VideoInfoState extends State<VideoInfo> {
|
|||||||
Text(
|
Text(
|
||||||
videoDetailCtr.videoLabel.value,
|
videoDetailCtr.videoLabel.value,
|
||||||
textScaler: TextScaler.noScaling,
|
textScaler: TextScaler.noScaling,
|
||||||
strutStyle: const StrutStyle(leading: 0, height: 1),
|
strutStyle: const StrutStyle(
|
||||||
|
leading: 0,
|
||||||
|
height: 1,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
height: 1,
|
height: 1,
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
@@ -185,33 +220,21 @@ class _VideoInfoState extends State<VideoInfo> {
|
|||||||
const TextSpan(text: ' '),
|
const TextSpan(text: ' '),
|
||||||
],
|
],
|
||||||
if (videoDetail.isUpowerExclusive == true) ...[
|
if (videoDetail.isUpowerExclusive == true) ...[
|
||||||
WidgetSpan(
|
_labelWidget(
|
||||||
alignment: PlaceholderAlignment.middle,
|
'充电专属',
|
||||||
child: Container(
|
isDark
|
||||||
padding: const EdgeInsets.symmetric(
|
? theme.colorScheme.error
|
||||||
horizontal: 4,
|
: theme.colorScheme.errorContainer,
|
||||||
vertical: 2,
|
isDark
|
||||||
),
|
? theme.colorScheme.onError
|
||||||
decoration: BoxDecoration(
|
: theme.colorScheme.onErrorContainer,
|
||||||
color: isDark
|
),
|
||||||
? theme.colorScheme.error
|
const TextSpan(text: ' '),
|
||||||
: theme.colorScheme.errorContainer,
|
] else if (videoDetail.rights?.isSteinGate == 1) ...[
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
_labelWidget(
|
||||||
),
|
'互动视频',
|
||||||
child: Text(
|
theme.colorScheme.secondaryContainer,
|
||||||
'充电专属',
|
theme.colorScheme.onSecondaryContainer,
|
||||||
textScaler: TextScaler.noScaling,
|
|
||||||
strutStyle: const StrutStyle(leading: 0, height: 1),
|
|
||||||
style: TextStyle(
|
|
||||||
height: 1,
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: isDark
|
|
||||||
? theme.colorScheme.onError
|
|
||||||
: theme.colorScheme.onErrorContainer,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const TextSpan(text: ' '),
|
const TextSpan(text: ' '),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user