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,11 +64,15 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
? 0
|
? 0
|
||||||
: StyleString.imgRadius.x,
|
: StyleString.imgRadius.x,
|
||||||
),
|
),
|
||||||
child: CachedNetworkImage(
|
child: Builder(
|
||||||
imageUrl: imageUrl.http2https,
|
builder: (context) => CachedNetworkImage(
|
||||||
|
imageUrl:
|
||||||
|
'${src?.startsWith('//') == true ? 'https:$src' : src}${thumbnail ? '@${quality ?? defaultImgQuality}q.webp' : ''}'
|
||||||
|
.http2https,
|
||||||
width: width,
|
width: width,
|
||||||
height:
|
height: ignoreHeight == null || ignoreHeight == false
|
||||||
ignoreHeight == null || ignoreHeight == false ? height : null,
|
? height
|
||||||
|
: null,
|
||||||
memCacheWidth: memCacheWidth,
|
memCacheWidth: memCacheWidth,
|
||||||
memCacheHeight: memCacheHeight,
|
memCacheHeight: memCacheHeight,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
@@ -86,6 +89,11 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
placeholder: (BuildContext context, String url) =>
|
placeholder: (BuildContext context, String url) =>
|
||||||
placeholder(context),
|
placeholder(context),
|
||||||
imageBuilder: imageBuilder,
|
imageBuilder: imageBuilder,
|
||||||
|
errorListener: (value) {
|
||||||
|
thumbnail = false;
|
||||||
|
(context as Element).markNeedsBuild();
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: placeholder(context);
|
: placeholder(context);
|
||||||
|
|||||||
Reference in New Issue
Block a user