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;
|
||||
color = Colors.white;
|
||||
case PBadgeType.error:
|
||||
if (Get.isDarkMode) {
|
||||
bgColor = theme.errorContainer;
|
||||
color = theme.onErrorContainer;
|
||||
} else {
|
||||
bgColor = theme.error;
|
||||
color = theme.onError;
|
||||
}
|
||||
case PBadgeType.line_primary:
|
||||
color = theme.primary;
|
||||
bgColor = Colors.transparent;
|
||||
|
||||
@@ -1165,7 +1165,7 @@ class Badge {
|
||||
String? text;
|
||||
|
||||
Badge.fromJson(Map<String, dynamic> json) {
|
||||
text = json['text'];
|
||||
text = json['text'] == '投稿视频' ? null : json['text'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,23 @@ Widget livePanelSub(
|
||||
PBadge(
|
||||
text: content.watchedShow?.textLarge,
|
||||
top: 6,
|
||||
right: 56,
|
||||
right: 70,
|
||||
fontSize: 10.5,
|
||||
type: PBadgeType.gray,
|
||||
),
|
||||
PBadge(
|
||||
text: content.liveStatus == 1 ? '直播中' : '直播结束',
|
||||
if (content.liveStatus == 1)
|
||||
Positioned(
|
||||
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,
|
||||
),
|
||||
|
||||
@@ -41,13 +41,26 @@ Widget liveRcmdPanel(
|
||||
PBadge(
|
||||
text: liveRcmd.watchedShow?.textLarge,
|
||||
top: 6,
|
||||
right: 56,
|
||||
right: 65,
|
||||
fontSize: 10.5,
|
||||
type: PBadgeType.gray,
|
||||
),
|
||||
PBadge(
|
||||
text: liveRcmd.liveStatus == 1 ? '直播中' : '直播结束',
|
||||
if (liveRcmd.liveStatus == 1)
|
||||
Positioned(
|
||||
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)
|
||||
Positioned(
|
||||
|
||||
@@ -76,9 +76,10 @@ Widget videoSeasonWidget(
|
||||
right: 10.0,
|
||||
bottom: null,
|
||||
left: null,
|
||||
type: itemContent.badge!.text == '充电专属'
|
||||
? PBadgeType.error
|
||||
: PBadgeType.primary,
|
||||
type: switch (itemContent.badge!.text) {
|
||||
'充电专属' => PBadgeType.error,
|
||||
_ => PBadgeType.primary,
|
||||
},
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
||||
@@ -203,7 +203,6 @@ class _MainAppState extends State<MainApp>
|
||||
),
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(toolbarHeight: 0),
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
|
||||
Reference in New Issue
Block a user