mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt dyn badge
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -59,8 +59,13 @@ class PBadge extends StatelessWidget {
|
|||||||
bgColor = Colors.black45;
|
bgColor = Colors.black45;
|
||||||
color = Colors.white;
|
color = Colors.white;
|
||||||
case PBadgeType.error:
|
case PBadgeType.error:
|
||||||
bgColor = theme.error;
|
if (Get.isDarkMode) {
|
||||||
color = theme.onError;
|
bgColor = theme.errorContainer;
|
||||||
|
color = theme.onErrorContainer;
|
||||||
|
} else {
|
||||||
|
bgColor = theme.error;
|
||||||
|
color = theme.onError;
|
||||||
|
}
|
||||||
case PBadgeType.line_primary:
|
case PBadgeType.line_primary:
|
||||||
color = theme.primary;
|
color = theme.primary;
|
||||||
bgColor = Colors.transparent;
|
bgColor = Colors.transparent;
|
||||||
|
|||||||
@@ -1165,7 +1165,7 @@ class Badge {
|
|||||||
String? text;
|
String? text;
|
||||||
|
|
||||||
Badge.fromJson(Map<String, dynamic> json) {
|
Badge.fromJson(Map<String, dynamic> json) {
|
||||||
text = json['text'];
|
text = json['text'] == '投稿视频' ? null : json['text'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,26 @@ Widget livePanelSub(
|
|||||||
PBadge(
|
PBadge(
|
||||||
text: content.watchedShow?.textLarge,
|
text: content.watchedShow?.textLarge,
|
||||||
top: 6,
|
top: 6,
|
||||||
right: 56,
|
right: 70,
|
||||||
|
fontSize: 10.5,
|
||||||
type: PBadgeType.gray,
|
type: PBadgeType.gray,
|
||||||
),
|
),
|
||||||
PBadge(
|
if (content.liveStatus == 1)
|
||||||
text: content.liveStatus == 1 ? '直播中' : '直播结束',
|
Positioned(
|
||||||
top: 6,
|
right: 6,
|
||||||
right: 6,
|
top: 6,
|
||||||
),
|
child: Image.asset(
|
||||||
|
height: 16,
|
||||||
|
'assets/images/live/live.gif',
|
||||||
|
filterQuality: FilterQuality.low,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
const PBadge(
|
||||||
|
text: '直播结束',
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
),
|
||||||
if (content.areaName != null)
|
if (content.areaName != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
|
|||||||
@@ -41,14 +41,27 @@ Widget liveRcmdPanel(
|
|||||||
PBadge(
|
PBadge(
|
||||||
text: liveRcmd.watchedShow?.textLarge,
|
text: liveRcmd.watchedShow?.textLarge,
|
||||||
top: 6,
|
top: 6,
|
||||||
right: 56,
|
right: 65,
|
||||||
|
fontSize: 10.5,
|
||||||
type: PBadgeType.gray,
|
type: PBadgeType.gray,
|
||||||
),
|
),
|
||||||
PBadge(
|
if (liveRcmd.liveStatus == 1)
|
||||||
text: liveRcmd.liveStatus == 1 ? '直播中' : '直播结束',
|
Positioned(
|
||||||
top: 6,
|
right: 6,
|
||||||
right: 6,
|
top: 6,
|
||||||
),
|
child: Image.asset(
|
||||||
|
height: 16,
|
||||||
|
'assets/images/live/live.gif',
|
||||||
|
filterQuality: FilterQuality.low,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
const PBadge(
|
||||||
|
text: '直播结束',
|
||||||
|
top: 6,
|
||||||
|
right: 6,
|
||||||
|
type: PBadgeType.gray,
|
||||||
|
),
|
||||||
if (liveRcmd.areaName != null)
|
if (liveRcmd.areaName != null)
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
|
|||||||
@@ -76,9 +76,10 @@ Widget videoSeasonWidget(
|
|||||||
right: 10.0,
|
right: 10.0,
|
||||||
bottom: null,
|
bottom: null,
|
||||||
left: null,
|
left: null,
|
||||||
type: itemContent.badge!.text == '充电专属'
|
type: switch (itemContent.badge!.text) {
|
||||||
? PBadgeType.error
|
'充电专属' => PBadgeType.error,
|
||||||
: PBadgeType.primary,
|
_ => PBadgeType.primary,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
|
|||||||
@@ -203,7 +203,6 @@ class _MainAppState extends State<MainApp>
|
|||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
resizeToAvoidBottomInset: false,
|
|
||||||
appBar: AppBar(toolbarHeight: 0),
|
appBar: AppBar(toolbarHeight: 0),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
bottom: false,
|
bottom: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user