mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 20:16:26 +08:00
feat: custom show argue msg
Closes #63 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -395,6 +395,12 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
);
|
||||
},
|
||||
),
|
||||
SetSwitchItem(
|
||||
title: '显示视频警告/争议信息',
|
||||
leading: const Icon(Icons.warning_amber_rounded),
|
||||
setKey: SettingBoxKey.showArgueMsg,
|
||||
defaultVal: true,
|
||||
),
|
||||
Obx(
|
||||
() => ListTile(
|
||||
enableFeedback: true,
|
||||
|
||||
@@ -80,6 +80,8 @@ class VideoIntroController extends GetxController
|
||||
|
||||
ExpandableController? expandableCtr;
|
||||
|
||||
late final showArgueMsg = GStorage.showArgueMsg;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
@@ -427,6 +427,41 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
]
|
||||
],
|
||||
),
|
||||
if (videoIntroController.videoDetail.value.argueMsg?.isNotEmpty ==
|
||||
true &&
|
||||
videoIntroController.showArgueMsg) ...[
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||
),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
child: Text.rich(
|
||||
TextSpan(children: [
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Icon(
|
||||
size: 17,
|
||||
Icons.warning_rounded,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text:
|
||||
' ${videoIntroController.videoDetail.value.argueMsg}')
|
||||
]),
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 8),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
|
||||
Reference in New Issue
Block a user