mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-22 03:31:09 +08:00
@@ -30,6 +30,7 @@ import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -362,14 +363,14 @@ class _ArticlePageState extends State<ArticlePage>
|
||||
if (_articleCtr.isLoaded.value) {
|
||||
late Widget content;
|
||||
if (_articleCtr.opus != null) {
|
||||
debugPrint('json page');
|
||||
if (kDebugMode) debugPrint('json page');
|
||||
content = OpusContent(
|
||||
opus: _articleCtr.opus!,
|
||||
callback: _getImageCallback,
|
||||
maxWidth: maxWidth,
|
||||
);
|
||||
} else if (_articleCtr.opusData?.modules.moduleBlocked != null) {
|
||||
debugPrint('moduleBlocked');
|
||||
if (kDebugMode) debugPrint('moduleBlocked');
|
||||
final moduleBlocked =
|
||||
_articleCtr.opusData!.modules.moduleBlocked!;
|
||||
content = SliverToBoxAdapter(
|
||||
@@ -380,7 +381,7 @@ class _ArticlePageState extends State<ArticlePage>
|
||||
// json
|
||||
return ReadOpus(ops: _articleCtr.articleData?.ops);
|
||||
}
|
||||
debugPrint('html page');
|
||||
if (kDebugMode) debugPrint('html page');
|
||||
final res = parser.parse(_articleCtr.articleData!.content!);
|
||||
if (res.body!.children.isEmpty) {
|
||||
content = SliverToBoxAdapter(
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:html/dom.dart' as dom;
|
||||
@@ -15,7 +16,7 @@ Widget htmlRender({
|
||||
required double maxWidth,
|
||||
Function(List<String>, int)? callback,
|
||||
}) {
|
||||
debugPrint('htmlRender');
|
||||
if (kDebugMode) debugPrint('htmlRender');
|
||||
final extensions = [
|
||||
TagExtension(
|
||||
tagsToExtend: <String>{'img'},
|
||||
@@ -71,7 +72,7 @@ Widget htmlRender({
|
||||
),
|
||||
);
|
||||
} catch (err) {
|
||||
debugPrint('错误的HTML: $element');
|
||||
if (kDebugMode) debugPrint('错误的HTML: $element');
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:cached_network_svg_image/cached_network_svg_image.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -55,7 +56,7 @@ class OpusContent extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint('opusContent');
|
||||
if (kDebugMode) debugPrint('opusContent');
|
||||
|
||||
if (opus.isEmpty) {
|
||||
return const SliverToBoxAdapter();
|
||||
@@ -552,7 +553,7 @@ class OpusContent extends StatelessWidget {
|
||||
child: SelectionArea(child: Text.rich(renderer.span!)),
|
||||
);
|
||||
default:
|
||||
debugPrint('unknown type ${element.paraType}');
|
||||
if (kDebugMode) debugPrint('unknown type ${element.paraType}');
|
||||
if (element.text?.nodes?.isNotEmpty == true) {
|
||||
return SelectionArea(
|
||||
child: Text.rich(
|
||||
|
||||
Reference in New Issue
Block a user