mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: failed to load some emotes
*end with "@162w" Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -44,8 +44,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
late final int defaultImgQuality = GlobalData().imgQuality;
|
late final int defaultImgQuality = GlobalData().imgQuality;
|
||||||
final String imageUrl =
|
bool thumbnail = true;
|
||||||
'${src?.startsWith('//') == true ? 'https:$src' : src}@${quality ?? defaultImgQuality}q.webp';
|
|
||||||
int? memCacheWidth, memCacheHeight;
|
int? memCacheWidth, memCacheHeight;
|
||||||
|
|
||||||
if (callback?.call() == true || width <= height) {
|
if (callback?.call() == true || width <= height) {
|
||||||
@@ -65,27 +64,36 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
? 0
|
? 0
|
||||||
: StyleString.imgRadius.x,
|
: StyleString.imgRadius.x,
|
||||||
),
|
),
|
||||||
child: CachedNetworkImage(
|
child: Builder(
|
||||||
imageUrl: imageUrl.http2https,
|
builder: (context) => CachedNetworkImage(
|
||||||
width: width,
|
imageUrl:
|
||||||
height:
|
'${src?.startsWith('//') == true ? 'https:$src' : src}${thumbnail ? '@${quality ?? defaultImgQuality}q.webp' : ''}'
|
||||||
ignoreHeight == null || ignoreHeight == false ? height : null,
|
.http2https,
|
||||||
memCacheWidth: memCacheWidth,
|
width: width,
|
||||||
memCacheHeight: memCacheHeight,
|
height: ignoreHeight == null || ignoreHeight == false
|
||||||
fit: BoxFit.cover,
|
? height
|
||||||
alignment: isLongPic?.call() == true
|
: null,
|
||||||
? Alignment.topCenter
|
memCacheWidth: memCacheWidth,
|
||||||
: Alignment.center,
|
memCacheHeight: memCacheHeight,
|
||||||
fadeOutDuration:
|
fit: BoxFit.cover,
|
||||||
fadeOutDuration ?? const Duration(milliseconds: 120),
|
alignment: isLongPic?.call() == true
|
||||||
fadeInDuration:
|
? Alignment.topCenter
|
||||||
fadeInDuration ?? const Duration(milliseconds: 120),
|
: Alignment.center,
|
||||||
filterQuality: FilterQuality.low,
|
fadeOutDuration:
|
||||||
errorWidget: (BuildContext context, String url, Object error) =>
|
fadeOutDuration ?? const Duration(milliseconds: 120),
|
||||||
placeholder(context),
|
fadeInDuration:
|
||||||
placeholder: (BuildContext context, String url) =>
|
fadeInDuration ?? const Duration(milliseconds: 120),
|
||||||
placeholder(context),
|
filterQuality: FilterQuality.low,
|
||||||
imageBuilder: imageBuilder,
|
errorWidget: (BuildContext context, String url, Object error) =>
|
||||||
|
placeholder(context),
|
||||||
|
placeholder: (BuildContext context, String url) =>
|
||||||
|
placeholder(context),
|
||||||
|
imageBuilder: imageBuilder,
|
||||||
|
errorListener: (value) {
|
||||||
|
thumbnail = false;
|
||||||
|
(context as Element).markNeedsBuild();
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: placeholder(context);
|
: placeholder(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user