fix: article

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-08 23:50:17 +08:00
parent 76545397d4
commit 634612c1a2
3 changed files with 4 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ Widget articleContent({
Function(List<String>, int)? callback, Function(List<String>, int)? callback,
required double maxWidth, required double maxWidth,
}) { }) {
debugPrint('articleContent');
List<String>? imgList = list List<String>? imgList = list
.where((item) => item.pic != null) .where((item) => item.pic != null)
.toList() .toList()

View File

@@ -13,6 +13,7 @@ Widget htmlRender({
required double constrainedWidth, required double constrainedWidth,
Function(List<String>, int)? callback, Function(List<String>, int)? callback,
}) { }) {
debugPrint('htmlRender');
return SelectionArea( return SelectionArea(
child: Html( child: Html(
data: htmlContent, data: htmlContent,

View File

@@ -568,12 +568,12 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
sliver: Obx( sliver: Obx(
() => _htmlRenderCtr.loaded.value () => _htmlRenderCtr.loaded.value
? _htmlRenderCtr.response['isJsonContent'] == true ? _htmlRenderCtr.response['isJsonContent'] == true
? LayoutBuilder( ? SliverLayoutBuilder(
builder: (context, constraints) => articleContent( builder: (context, constraints) => articleContent(
context: context, context: context,
list: _htmlRenderCtr.response['content'], list: _htmlRenderCtr.response['content'],
callback: _getImageCallback, callback: _getImageCallback,
maxWidth: constraints.maxWidth, maxWidth: constraints.crossAxisExtent,
), ),
) )
: SliverToBoxAdapter( : SliverToBoxAdapter(