Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-21 14:26:29 +08:00
parent 0b1f6c4d0e
commit 7a65b777c9
21 changed files with 486 additions and 507 deletions

View File

@@ -60,15 +60,14 @@ class ImageModel {
bool? _isLongPic;
bool? _isLivePhoto;
bool get isLongPic => _isLongPic ??= (height / width) > _maxRatio;
bool get isLongPic =>
_isLongPic ??= (height / width) > StyleString.imgMaxRatio;
bool get isLivePhoto =>
_isLivePhoto ??= enableLivePhoto && liveUrl?.isNotEmpty == true;
static bool enableLivePhoto = Pref.enableLivePhoto;
}
const double _maxRatio = 22 / 9;
class CustomGridView extends StatelessWidget {
const CustomGridView({
super.key,
@@ -222,7 +221,7 @@ class CustomGridView extends StatelessWidget {
if (width != 1) {
imageWidth = min(imageWidth, width.toDouble());
}
imageHeight = imageWidth * min(ratioHW, _maxRatio);
imageHeight = imageWidth * min(ratioHW, StyleString.imgMaxRatio);
}
}

View File

@@ -14,7 +14,7 @@ void imageSaveDialog({
dynamic aid,
String? bvid,
}) {
final double imgWidth = MediaQuery.sizeOf(Get.context!).shortestSide - 8 * 2;
final double imgWidth = MediaQuery.sizeOf(Get.context!).shortestSide - 16;
SmartDialog.show(
animationType: SmartAnimationType.centerScale_otherSlide,
builder: (context) {
@@ -22,7 +22,7 @@ void imageSaveDialog({
final theme = Theme.of(context);
return Container(
width: imgWidth,
margin: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
margin: const .symmetric(horizontal: StyleString.safeSpace),
decoration: BoxDecoration(
color: theme.colorScheme.surface,
borderRadius: StyleString.mdRadius,
@@ -36,32 +36,29 @@ void imageSaveDialog({
GestureDetector(
onTap: SmartDialog.dismiss,
child: NetworkImgLayer(
width: imgWidth,
height: imgWidth / StyleString.aspectRatio,
src: cover,
quality: 100,
width: imgWidth,
height: imgWidth / StyleString.aspectRatio16x9,
borderRadius: const .vertical(top: StyleString.imgRadius),
),
),
Positioned(
right: 8,
top: 8,
child: SizedBox(
width: 30,
height: 30,
child: IconButton(
tooltip: '关闭',
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll(
Colors.black.withValues(alpha: 0.3),
),
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
),
onPressed: SmartDialog.dismiss,
icon: const Icon(
Icons.close,
size: 18,
color: Colors.white,
),
width: 30,
height: 30,
child: IconButton(
tooltip: '关闭',
style: IconButton.styleFrom(
padding: .zero,
backgroundColor: Colors.black.withValues(alpha: 0.3),
),
onPressed: SmartDialog.dismiss,
icon: const Icon(
Icons.close,
size: 18,
color: Colors.white,
),
),
),