mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -32,7 +32,7 @@ Widget htmlRender({
|
|||||||
final bool isEmote = imgUrl.contains('/emote/');
|
final bool isEmote = imgUrl.contains('/emote/');
|
||||||
final bool isMall = imgUrl.contains('/mall/');
|
final bool isMall = imgUrl.contains('/mall/');
|
||||||
if (isMall) {
|
if (isMall) {
|
||||||
return const SizedBox();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
// bool inTable =
|
// bool inTable =
|
||||||
// extensionContext.element!.previousElementSibling == null ||
|
// extensionContext.element!.previousElementSibling == null ||
|
||||||
@@ -43,6 +43,18 @@ Widget htmlRender({
|
|||||||
// width: isEmote ? 22 : null,
|
// width: isEmote ? 22 : null,
|
||||||
// height: isEmote ? 22 : null,
|
// height: isEmote ? 22 : null,
|
||||||
// );
|
// );
|
||||||
|
String? height = RegExp(r'max-height:(\d+)px')
|
||||||
|
.firstMatch('${attributes['style']}')
|
||||||
|
?.group(1);
|
||||||
|
if (height != null) {
|
||||||
|
return NetworkImgLayer(
|
||||||
|
width: constrainedWidth,
|
||||||
|
height: double.parse(height),
|
||||||
|
src: imgUrl,
|
||||||
|
type: 'emote',
|
||||||
|
boxFit: BoxFit.contain,
|
||||||
|
);
|
||||||
|
}
|
||||||
return Hero(
|
return Hero(
|
||||||
tag: imgUrl,
|
tag: imgUrl,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
this.isLongPic,
|
this.isLongPic,
|
||||||
this.callback,
|
this.callback,
|
||||||
this.getPlaceHolder,
|
this.getPlaceHolder,
|
||||||
|
this.boxFit,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? src;
|
final String? src;
|
||||||
@@ -38,6 +39,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
final Function? isLongPic;
|
final Function? isLongPic;
|
||||||
final Function? callback;
|
final Function? callback;
|
||||||
final Function? getPlaceHolder;
|
final Function? getPlaceHolder;
|
||||||
|
final BoxFit? boxFit;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -68,7 +70,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
height: ignoreHeight == null || ignoreHeight == false ? height : null,
|
height: ignoreHeight == null || ignoreHeight == false ? height : null,
|
||||||
memCacheWidth: memCacheWidth,
|
memCacheWidth: memCacheWidth,
|
||||||
memCacheHeight: memCacheHeight,
|
memCacheHeight: memCacheHeight,
|
||||||
fit: BoxFit.cover,
|
fit: boxFit ?? BoxFit.cover,
|
||||||
alignment:
|
alignment:
|
||||||
isLongPic?.call() == true ? Alignment.topCenter : Alignment.center,
|
isLongPic?.call() == true ? Alignment.topCenter : Alignment.center,
|
||||||
fadeOutDuration: fadeOutDuration ?? const Duration(milliseconds: 120),
|
fadeOutDuration: fadeOutDuration ?? const Duration(milliseconds: 120),
|
||||||
|
|||||||
@@ -203,8 +203,7 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
|
|||||||
window.flutter_inappwebview.callHandler('finishButtonClicked');
|
window.flutter_inappwebview.callHandler('finishButtonClicked');
|
||||||
});
|
});
|
||||||
""");
|
""");
|
||||||
}
|
} else if (url.toString().startsWith('https://live.bilibili.com')) {
|
||||||
if (url.toString().startsWith('https://live.bilibili.com')) {
|
|
||||||
_webViewController?.evaluateJavascript(
|
_webViewController?.evaluateJavascript(
|
||||||
source: '''
|
source: '''
|
||||||
document.styleSheets[0].insertRule('div.open-app-btn.bili-btn-warp {display:none;}', 0);
|
document.styleSheets[0].insertRule('div.open-app-btn.bili-btn-warp {display:none;}', 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user