Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-19 15:32:46 +08:00
parent 099c7b4dff
commit 51c605f5d0
16 changed files with 227 additions and 171 deletions

View File

@@ -1,6 +1,7 @@
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
import 'package:PiliPlus/pages/common/slide/common_slide_page.dart';
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/selectable_text.dart';
import 'package:PiliPlus/utils/duration_utils.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@@ -69,7 +70,7 @@ class _AiDetailState extends State<AiConclusionPanel>
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14),
child: SelectableText(
child: selectableText(
widget.item.summary!,
style: const TextStyle(
fontSize: 15,
@@ -98,57 +99,59 @@ class _AiDetailState extends State<AiConclusionPanel>
itemCount: widget.item.outline!.length,
itemBuilder: (context, index) {
final item = widget.item.outline![index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (index != 0) const SizedBox(height: 10),
SelectableText(
item.title!,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
height: 1.5,
return SelectionArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (index != 0) const SizedBox(height: 10),
Text(
item.title!,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
height: 1.5,
),
),
),
const SizedBox(height: 6),
...?item.partOutline?.map(
(item) => Wrap(
children: [
SelectableText.rich(
TextSpan(
style: TextStyle(
fontSize: 14,
color: theme.colorScheme.onSurface,
height: 1.5,
),
children: [
TextSpan(
text: DurationUtils.formatDuration(
item.timestamp,
),
style: TextStyle(
color: theme.colorScheme.primary,
),
recognizer: TapGestureRecognizer()
..onTap = () {
try {
Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'],
).plPlayerController.seekTo(
Duration(seconds: item.timestamp!),
);
} catch (_) {}
},
const SizedBox(height: 6),
...?item.partOutline?.map(
(item) => Wrap(
children: [
Text.rich(
TextSpan(
style: TextStyle(
fontSize: 14,
color: theme.colorScheme.onSurface,
height: 1.5,
),
const TextSpan(text: ' '),
TextSpan(text: item.content!),
],
children: [
TextSpan(
text: DurationUtils.formatDuration(
item.timestamp,
),
style: TextStyle(
color: theme.colorScheme.primary,
),
recognizer: TapGestureRecognizer()
..onTap = () {
try {
Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'],
).plPlayerController.seekTo(
Duration(seconds: item.timestamp!),
);
} catch (_) {}
},
),
const TextSpan(text: ' '),
TextSpan(text: item.content!),
],
),
),
),
],
],
),
),
),
],
],
),
);
},
),