clean up models

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-05 12:10:18 +08:00
parent b897103af0
commit 279f21857d
308 changed files with 156 additions and 6243 deletions

View File

@@ -1,19 +1,17 @@
import 'package:flutter/foundation.dart';
class Cover {
int? height;
String? url;
int? width;
late double ratio;
Cover({this.height, this.url, this.width, required this.ratio});
Cover({required this.ratio});
Cover.fromJson(Map<String, dynamic> json) {
height = json['height'] as int?;
url = json['url'] as String?;
width = json['width'] as int?;
final height = json['height'] as int?;
final width = json['width'] as int?;
if (height != null && width != null) {
ratio = clampDouble(height! / width!, 0.68, 2.7);
ratio = clampDouble(height / width, 0.68, 2.7);
} else {
ratio = 1;
}