下载新版本

This commit is contained in:
GYJ
2024-12-10 16:58:37 +08:00
parent 36a0e183ff
commit 8cae1ffd7d
9 changed files with 424 additions and 5 deletions

View File

@@ -0,0 +1,128 @@
import 'dart:convert';
/// createdAt : 1712455187626
/// id : 19
/// isUp : 0
/// message : "需要更新"
/// sel : 1
/// source : "PC"
/// type : "android"
/// updatedAt : 1725353572331
/// url : "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/version/1.4.20.exe"
/// version : "1.4.21"
UpdateVersionModel updateVersionModelFromJson(String str) =>
UpdateVersionModel.fromJson(json.decode(str));
String updateVersionModelToJson(UpdateVersionModel data) =>
json.encode(data.toJson());
class UpdateVersionModel {
UpdateVersionModel({
num? createdAt,
num? id,
num? isUp,
String? message,
num? sel,
String? source,
String? type,
num? updatedAt,
String? url,
String? version,
}) {
_createdAt = createdAt;
_id = id;
_isUp = isUp;
_message = message;
_sel = sel;
_source = source;
_type = type;
_updatedAt = updatedAt;
_url = url;
_version = version;
}
UpdateVersionModel.fromJson(dynamic json) {
_createdAt = json['createdAt'];
_id = json['id'];
_isUp = json['isUp'];
_message = json['message'];
_sel = json['sel'];
_source = json['source'];
_type = json['type'];
_updatedAt = json['updatedAt'];
_url = json['url'];
_version = json['version'];
}
num? _createdAt;
num? _id;
num? _isUp;
String? _message;
num? _sel;
String? _source;
String? _type;
num? _updatedAt;
String? _url;
String? _version;
UpdateVersionModel copyWith({
num? createdAt,
num? id,
num? isUp,
String? message,
num? sel,
String? source,
String? type,
num? updatedAt,
String? url,
String? version,
}) =>
UpdateVersionModel(
createdAt: createdAt ?? _createdAt,
id: id ?? _id,
isUp: isUp ?? _isUp,
message: message ?? _message,
sel: sel ?? _sel,
source: source ?? _source,
type: type ?? _type,
updatedAt: updatedAt ?? _updatedAt,
url: url ?? _url,
version: version ?? _version,
);
num? get createdAt => _createdAt;
num? get id => _id;
num? get isUp => _isUp;
String? get message => _message;
num? get sel => _sel;
String? get source => _source;
String? get type => _type;
num? get updatedAt => _updatedAt;
String? get url => _url;
String? get version => _version;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['createdAt'] = _createdAt;
map['id'] = _id;
map['isUp'] = _isUp;
map['message'] = _message;
map['sel'] = _sel;
map['source'] = _source;
map['type'] = _type;
map['updatedAt'] = _updatedAt;
map['url'] = _url;
map['version'] = _version;
return map;
}
}