mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-29 23:05:55 +08:00
@@ -19,7 +19,6 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
this.quality,
|
||||
this.semanticsLabel,
|
||||
this.radius,
|
||||
this.imageBuilder,
|
||||
this.isLongPic = false,
|
||||
this.forceUseCacheWidth = false,
|
||||
this.getPlaceHolder,
|
||||
@@ -35,7 +34,6 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
final int? quality;
|
||||
final String? semanticsLabel;
|
||||
final double? radius;
|
||||
final ImageWidgetBuilder? imageBuilder;
|
||||
final bool isLongPic;
|
||||
final bool forceUseCacheWidth;
|
||||
final Widget Function()? getPlaceHolder;
|
||||
@@ -93,9 +91,8 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
fadeOutDuration: fadeOutDuration ?? const Duration(milliseconds: 120),
|
||||
fadeInDuration: fadeInDuration ?? const Duration(milliseconds: 120),
|
||||
filterQuality: FilterQuality.low,
|
||||
placeholder: (BuildContext context, String url) =>
|
||||
placeholder: (context, url) =>
|
||||
getPlaceHolder?.call() ?? _placeholder(context, noRadius),
|
||||
imageBuilder: imageBuilder,
|
||||
errorWidget: (context, url, error) => _placeholder(context, noRadius),
|
||||
colorBlendMode: reduce ? BlendMode.modulate : null,
|
||||
color: reduce ? reduceLuxColor : null,
|
||||
|
||||
@@ -340,6 +340,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
fadeInDuration: Duration.zero,
|
||||
fadeOutDuration: Duration.zero,
|
||||
imageUrl: ImageUtils.thumbnailUrl(item.url, widget.quality),
|
||||
placeholder: (_, _) => const SizedBox.expand(),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -47,10 +47,10 @@ class HttpError extends StatelessWidget {
|
||||
if (onReload != null)
|
||||
FilledButton.tonal(
|
||||
onPressed: onReload,
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
theme.colorScheme.primary.withAlpha(20),
|
||||
),
|
||||
style: FilledButton.styleFrom(
|
||||
tapTargetSize: .padded,
|
||||
backgroundColor: theme.colorScheme.primary.withAlpha(20),
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
child: Text(
|
||||
btnText ?? '点击重试',
|
||||
|
||||
@@ -2,10 +2,8 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/models/common/avatar_badge_type.dart';
|
||||
import 'package:PiliPlus/models/common/image_type.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PendantAvatar extends StatelessWidget {
|
||||
@@ -44,6 +42,23 @@ class PendantAvatar extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final isMemberAvatar = size == 80;
|
||||
Widget? pendant;
|
||||
if (showDynDecorate && !garbPendantImage.isNullOrEmpty) {
|
||||
final pendantSize = size * 1.75;
|
||||
pendant = Positioned(
|
||||
// -(size * 1.75 - size) / 2
|
||||
top: -0.375 * size + (size == 80 ? 2 : 0),
|
||||
child: IgnorePointer(
|
||||
child: NetworkImgLayer(
|
||||
radius: 0,
|
||||
width: pendantSize,
|
||||
height: pendantSize,
|
||||
src: garbPendantImage,
|
||||
getPlaceHolder: () => const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Stack(
|
||||
alignment: Alignment.bottomCenter,
|
||||
clipBehavior: Clip.none,
|
||||
@@ -55,19 +70,7 @@ class PendantAvatar extends StatelessWidget {
|
||||
onTap: onTap,
|
||||
child: _buildAvatar(colorScheme, isMemberAvatar),
|
||||
),
|
||||
if (showDynDecorate && !garbPendantImage.isNullOrEmpty)
|
||||
Positioned(
|
||||
top:
|
||||
-0.375 *
|
||||
(size == 80 ? size - 4 : size), // -(size * 1.75 - size) / 2
|
||||
child: IgnorePointer(
|
||||
child: CachedNetworkImage(
|
||||
width: size * 1.75,
|
||||
height: size * 1.75,
|
||||
imageUrl: ImageUtils.thumbnailUrl(garbPendantImage),
|
||||
),
|
||||
),
|
||||
),
|
||||
?pendant,
|
||||
if (roomId != null)
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
|
||||
Reference in New Issue
Block a user