opt image preview

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-14 14:41:48 +08:00
parent 352e314ee1
commit e7e79eb62a
5 changed files with 180 additions and 174 deletions

View File

@@ -1,5 +1,3 @@
import 'package:PiliPlus/common/constants.dart';
enum SourceType { fileImage, networkImage, livePhoto }
class SourceModel {
@@ -8,6 +6,7 @@ class SourceModel {
final String? liveUrl;
final int? width;
final int? height;
final bool isLongPic;
const SourceModel({
this.sourceType = SourceType.networkImage,
@@ -15,12 +14,6 @@ class SourceModel {
this.liveUrl,
this.width,
this.height,
this.isLongPic = false,
});
bool get isLongPic {
if (width != null && height != null) {
return height! / width! > StyleString.imgMaxRatio;
}
return false;
}
}