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);
}
}