feat: ai总结复制功能

This commit is contained in:
guozhigq
2024-04-19 00:01:09 +08:00
parent 0bce465eb7
commit a5e2d96b98

View File

@ -49,7 +49,7 @@ class AiDetail extends StatelessWidget {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Text( SelectableText(
modelResult!.summary!, modelResult!.summary!,
style: const TextStyle( style: const TextStyle(
fontSize: 15, fontSize: 15,
@ -60,13 +60,15 @@ class AiDetail extends StatelessWidget {
const SizedBox(height: 20), const SizedBox(height: 20),
ListView.builder( ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemCount: modelResult!.outline!.length,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemCount: modelResult!.outline!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final outline = modelResult!.outline![index];
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( SelectableText(
modelResult!.outline![index].title!, outline.title!,
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -77,76 +79,59 @@ class AiDetail extends StatelessWidget {
ListView.builder( ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemCount: modelResult! itemCount: outline.partOutline!.length,
.outline![index].partOutline!.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
final part = outline.partOutline![i];
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Wrap( GestureDetector(
children: [ onTap: () {
RichText( try {
text: TextSpan( final controller =
style: TextStyle( Get.find<VideoDetailController>(
fontSize: 13, tag: Get.arguments['heroTag'],
color: Theme.of(context) );
.colorScheme controller.plPlayerController.seekTo(
.onBackground, Duration(
height: 1.5, seconds: Utils.duration(
Utils.tampToSeektime(
part.timestamp!),
).toInt(),
), ),
children: [ );
TextSpan( } catch (_) {}
text: Utils.tampToSeektime( },
modelResult! child: SelectableText.rich(
.outline![index] TextSpan(
.partOutline![i] style: TextStyle(
.timestamp!), fontSize: 13,
style: TextStyle( color: Theme.of(context)
color: Theme.of(context) .colorScheme
.colorScheme .onBackground,
.primary, height: 1.5,
),
recognizer: TapGestureRecognizer()
..onTap = () {
// 跳转到指定位置
try {
Get.find<VideoDetailController>(
tag: Get.arguments[
'heroTag'])
.plPlayerController
.seekTo(
Duration(
seconds:
Utils.duration(
Utils.tampToSeektime(modelResult!
.outline![
index]
.partOutline![
i]
.timestamp!)
.toString(),
),
),
);
} catch (_) {}
},
),
const TextSpan(text: ' '),
TextSpan(
text: modelResult!
.outline![index]
.partOutline![i]
.content!),
],
), ),
children: [
TextSpan(
text: Utils.tampToSeektime(
part.timestamp!),
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
),
),
const TextSpan(text: ' '),
TextSpan(text: part.content!),
],
), ),
], ),
), ),
const SizedBox(height: 20),
], ],
); );
}, },
), ),
const SizedBox(height: 20),
], ],
); );
}, },