mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 12:24:47 +00:00
Added screen to update server
This commit is contained in:
parent
4e65f80baf
commit
e02b598be9
13 changed files with 819 additions and 34 deletions
55
lib/models/update_available.dart
Normal file
55
lib/models/update_available.dart
Normal file
|
@ -0,0 +1,55 @@
|
|||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
|
||||
class UpdateAvailable {
|
||||
LoadStatus loadStatus = LoadStatus.loading;
|
||||
UpdateAvailableData? data;
|
||||
|
||||
UpdateAvailable({
|
||||
required this.loadStatus,
|
||||
required this.data
|
||||
});
|
||||
}
|
||||
|
||||
class UpdateAvailableData {
|
||||
String currentVersion;
|
||||
final String newVersion;
|
||||
final String announcement;
|
||||
final String announcementUrl;
|
||||
final bool canAutoupdate;
|
||||
final bool disabled;
|
||||
String? changelog;
|
||||
bool? updateAvailable;
|
||||
|
||||
UpdateAvailableData({
|
||||
required this.currentVersion,
|
||||
required this.newVersion,
|
||||
required this.announcement,
|
||||
required this.announcementUrl,
|
||||
required this.canAutoupdate,
|
||||
required this.disabled,
|
||||
this.changelog,
|
||||
this.updateAvailable
|
||||
});
|
||||
|
||||
factory UpdateAvailableData.fromJson(Map<String, dynamic> json) => UpdateAvailableData(
|
||||
currentVersion: json["current_version"],
|
||||
newVersion: json["new_version"],
|
||||
announcement: json["announcement"],
|
||||
announcementUrl: json["announcement_url"],
|
||||
canAutoupdate: json["can_autoupdate"],
|
||||
disabled: json["disabled"],
|
||||
changelog: json["changelog"],
|
||||
updateAvailable: json['update_available']
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"current_version": currentVersion,
|
||||
"new_version": newVersion,
|
||||
"announcement": announcement,
|
||||
"announcement_url": announcementUrl,
|
||||
"can_autoupdate": canAutoupdate,
|
||||
"disabled": disabled,
|
||||
"changelog": changelog,
|
||||
"update_available": updateAvailable
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue