opt: 专栏内容可选

This commit is contained in:
guozhigq
2024-10-07 22:51:02 +08:00
parent 16847b8a92
commit a366f5d3ce
3 changed files with 8 additions and 7 deletions

View File

@ -157,7 +157,7 @@ class _OpusPageState extends State<OpusPage> {
Container(
alignment: TextHelper.getAlignment(paragraph.align),
margin: const EdgeInsets.only(bottom: 10),
child: Text.rich(
child: SelectableText.rich(
TextSpan(
children: paragraph.text?.nodes?.map((node) {
return TextHelper.buildTextSpan(

View File

@ -21,7 +21,7 @@ class ReadPageController extends GetxController {
super.onInit();
title.value = Get.parameters['title'] ?? '';
id = Get.parameters['id']!;
articleType = Get.parameters['articleType']!;
articleType = Get.parameters['articleType'] ?? 'read';
url = 'https://www.bilibili.com/read/cv$id';
scrollController.addListener(_scrollListener);
fetchViewInfo();

View File

@ -126,7 +126,6 @@ class _ReadPageState extends State<ReadPage> {
Widget _buildContent(ReadDataModel cvData) {
final List<String> picList = _extractPicList(cvData);
final List<String> imgList = extractDataSrc(cvData.readInfo!.content!);
return Padding(
padding: EdgeInsets.fromLTRB(
16, 0, 16, MediaQuery.of(context).padding.bottom + 40),
@ -163,10 +162,12 @@ class _ReadPageState extends State<ReadPage> {
padding: const EdgeInsets.only(bottom: 20),
child: _buildAuthorWidget(cvData),
),
HtmlRender(
SelectionArea(
child: HtmlRender(
htmlContent: cvData.readInfo!.content!,
imgList: imgList,
),
),
],
);
}
@ -206,7 +207,7 @@ class _ReadPageState extends State<ReadPage> {
return Container(
alignment: TextHelper.getAlignment(paragraph.align),
margin: const EdgeInsets.only(bottom: 10),
child: Text.rich(
child: SelectableText.rich(
TextSpan(
children: paragraph.text?.nodes?.map((node) {
return TextHelper.buildTextSpan(node, paragraph.align, context);