mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 08:38:18 +08:00
@@ -281,7 +281,7 @@ class CustomGridView extends StatelessWidget {
|
||||
width: imageWidth,
|
||||
height: imageHeight,
|
||||
alignment: item.isLongPic ? .topCenter : .center,
|
||||
forceUseCacheWidth: item.width <= item.height,
|
||||
cacheWidth: item.width <= item.height,
|
||||
getPlaceHolder: () => placeHolder,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -11,30 +11,30 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
super.key,
|
||||
required this.src,
|
||||
required this.width,
|
||||
this.height,
|
||||
required this.height,
|
||||
this.type = .def,
|
||||
this.fadeOutDuration = const Duration(milliseconds: 120),
|
||||
this.fadeInDuration = const Duration(milliseconds: 120),
|
||||
this.quality,
|
||||
this.borderRadius = StyleString.mdRadius,
|
||||
this.forceUseCacheWidth = false,
|
||||
this.getPlaceHolder,
|
||||
this.fit = .cover,
|
||||
this.alignment = .center,
|
||||
this.cacheWidth,
|
||||
});
|
||||
|
||||
final String? src;
|
||||
final double width;
|
||||
final double? height;
|
||||
final double height;
|
||||
final ImageType type;
|
||||
final Duration fadeOutDuration;
|
||||
final Duration fadeInDuration;
|
||||
final int? quality;
|
||||
final BorderRadius borderRadius;
|
||||
final bool forceUseCacheWidth;
|
||||
final ValueGetter<Widget>? getPlaceHolder;
|
||||
final BoxFit fit;
|
||||
final Alignment alignment;
|
||||
final bool? cacheWidth;
|
||||
|
||||
static Color? reduceLuxColor = Pref.reduceLuxColor;
|
||||
static bool reduce = false;
|
||||
@@ -64,10 +64,10 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
required bool isAvatar,
|
||||
}) {
|
||||
int? memCacheWidth, memCacheHeight;
|
||||
if (height == null || forceUseCacheWidth || width <= height!) {
|
||||
if (cacheWidth ?? width <= height) {
|
||||
memCacheWidth = width.cacheSize(context);
|
||||
} else {
|
||||
memCacheHeight = height?.cacheSize(context);
|
||||
memCacheHeight = height.cacheSize(context);
|
||||
}
|
||||
return CachedNetworkImage(
|
||||
imageUrl: ImageUtils.thumbnailUrl(src, quality),
|
||||
|
||||
@@ -2,14 +2,14 @@ class BaseEmote {
|
||||
late String url;
|
||||
late String emoticonUnique;
|
||||
late double width;
|
||||
double? height;
|
||||
late double height;
|
||||
late final isUpower = emoticonUnique.startsWith('upower_');
|
||||
|
||||
BaseEmote.fromJson(Map<String, dynamic> json) {
|
||||
url = json['url'];
|
||||
emoticonUnique = json['emoticon_unique'];
|
||||
width = (json['width'] as num).toDouble();
|
||||
height = (json['height'] as num?)?.toDouble();
|
||||
height = (json['height'] as num?)?.toDouble() ?? width;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
|
||||
@@ -234,11 +234,7 @@ class LiveRoomChatPanel extends StatelessWidget {
|
||||
src: uemote.url,
|
||||
type: ImageType.emote,
|
||||
width: isUpower ? uemote.width : uemote.width / devicePixelRatio,
|
||||
height: uemote.height == null
|
||||
? null
|
||||
: isUpower
|
||||
? uemote.height!
|
||||
: uemote.height! / devicePixelRatio,
|
||||
height: isUpower ? uemote.height : uemote.height / devicePixelRatio,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1602,7 +1602,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
src: videoDetailController.cover.value,
|
||||
width: width,
|
||||
height: height,
|
||||
forceUseCacheWidth: true,
|
||||
cacheWidth: true,
|
||||
getPlaceHolder: () => Center(
|
||||
child: Image.asset('assets/images/loading.png'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user