mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
update: update api
This commit is contained in:
@@ -1,54 +1,123 @@
|
||||
///
|
||||
/// Code generated by jsonToDartModel https://ashamp.github.io/jsonToDartModel/
|
||||
///
|
||||
class AppUpdate {
|
||||
/*
|
||||
{
|
||||
"newest": 33,
|
||||
"android": "https://v2.custed.lolli.tech/res/tiku/apk/33.apk",
|
||||
"ios": "https://",
|
||||
"min": 30,
|
||||
"changelog": ""
|
||||
}
|
||||
"changelog": {
|
||||
"mac": "xxx",
|
||||
"ios": "xxx",
|
||||
"android": ""
|
||||
},
|
||||
"build": {
|
||||
"min": {
|
||||
"mac": 1,
|
||||
"ios": 1,
|
||||
"android": 1
|
||||
},
|
||||
"last": {
|
||||
"mac": 1,
|
||||
"ios": 1,
|
||||
"android": 1
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"mac": "https://apps.apple.com/app/id1586449703",
|
||||
"ios": "https://apps.apple.com/app/id1586449703",
|
||||
"android": "https://cdn3.cust.app/uploads/ServerBox_262_Arm64.apk"
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
late int newest;
|
||||
late int iosbuild;
|
||||
late int androidbuild;
|
||||
late int macbuild;
|
||||
late String android;
|
||||
late String ios;
|
||||
late String mac;
|
||||
late int min;
|
||||
late String changelog;
|
||||
import 'dart:convert';
|
||||
|
||||
AppUpdate({
|
||||
required this.newest,
|
||||
required this.android,
|
||||
required this.ios,
|
||||
required this.min,
|
||||
required this.changelog,
|
||||
});
|
||||
AppUpdate.fromJson(Map<String, dynamic> json) {
|
||||
newest = json["newest"]?.toInt();
|
||||
macbuild = json["macbuild"]?.toInt();
|
||||
iosbuild = json["iosbuild"]?.toInt();
|
||||
androidbuild = json["androidbuild"]?.toInt();
|
||||
android = json["android"].toString();
|
||||
ios = json["ios"].toString();
|
||||
min = json["min"].toInt();
|
||||
changelog = json["changelog"].toString();
|
||||
}
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data["newest"] = newest;
|
||||
data["macbuild"] = macbuild;
|
||||
data["iosbuild"] = iosbuild;
|
||||
data["androidbuild"] = androidbuild;
|
||||
data["android"] = android;
|
||||
data["ios"] = ios;
|
||||
data["min"] = min;
|
||||
data["changelog"] = changelog;
|
||||
return data;
|
||||
}
|
||||
import '/core/utils/platform.dart';
|
||||
|
||||
class AppUpdate {
|
||||
AppUpdate({
|
||||
required this.changelog,
|
||||
required this.build,
|
||||
required this.url,
|
||||
});
|
||||
|
||||
final AppUpdatePlatformSpecific<String> changelog;
|
||||
final Build build;
|
||||
final AppUpdatePlatformSpecific<String> url;
|
||||
|
||||
factory AppUpdate.fromRawJson(String str) => AppUpdate.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AppUpdate.fromJson(Map<String, dynamic> json) => AppUpdate(
|
||||
changelog: AppUpdatePlatformSpecific.fromJson(json["changelog"]),
|
||||
build: Build.fromJson(json["build"]),
|
||||
url: AppUpdatePlatformSpecific.fromJson(json["url"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"changelog": changelog.toJson(),
|
||||
"build": build.toJson(),
|
||||
"url": url.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Build {
|
||||
Build({
|
||||
required this.min,
|
||||
required this.last,
|
||||
});
|
||||
|
||||
final AppUpdatePlatformSpecific<int> min;
|
||||
final AppUpdatePlatformSpecific<int> last;
|
||||
|
||||
factory Build.fromRawJson(String str) => Build.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory Build.fromJson(Map<String, dynamic> json) => Build(
|
||||
min: AppUpdatePlatformSpecific.fromJson(json["min"]),
|
||||
last: AppUpdatePlatformSpecific.fromJson(json["last"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"min": min.toJson(),
|
||||
"last": last.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class AppUpdatePlatformSpecific<T> {
|
||||
AppUpdatePlatformSpecific({
|
||||
required this.mac,
|
||||
required this.ios,
|
||||
required this.android,
|
||||
});
|
||||
|
||||
final T mac;
|
||||
final T ios;
|
||||
final T android;
|
||||
|
||||
factory AppUpdatePlatformSpecific.fromRawJson(String str) => AppUpdatePlatformSpecific.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory AppUpdatePlatformSpecific.fromJson(Map<String, dynamic> json) => AppUpdatePlatformSpecific(
|
||||
mac: json["mac"],
|
||||
ios: json["ios"],
|
||||
android: json["android"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"mac": mac,
|
||||
"ios": ios,
|
||||
"android": android,
|
||||
};
|
||||
|
||||
T? get current {
|
||||
switch (platform) {
|
||||
case PlatformType.macos:
|
||||
return mac;
|
||||
case PlatformType.ios:
|
||||
return ios;
|
||||
case PlatformType.android:
|
||||
return android;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 261;
|
||||
static const String engine = "Flutter 3.7.11 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision f72efea43c (5 days ago) • 2023-04-11 11:57:21 -0700\nEngine • revision 1a65d409c7\nTools • Dart 2.19.6 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-04-17 13:09:32.878040";
|
||||
static const int modifications = 5;
|
||||
static const int build = 262;
|
||||
static const String engine = "3.7.11";
|
||||
static const String buildAt = "2023-04-17 18:13:48.223240";
|
||||
static const int modifications = 4;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const backendUrl = 'https://res.lolli.tech';
|
||||
const baseUrl = '$backendUrl/toolbox';
|
||||
const baseUrl = '$backendUrl/serverbox';
|
||||
const joinQQGroupUrl = 'https://jq.qq.com/?_wv=1027&k=G0hUmPAq';
|
||||
const myGithub = 'https://github.com/lollipopkit';
|
||||
const issueUrl = '$myGithub/flutter_server_box/issues';
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:xterm/core.dart';
|
||||
|
||||
import '../model/ssh/virtual_key.dart';
|
||||
|
||||
var virtualKeys = [
|
||||
final virtualKeys = [
|
||||
VirtualKey('Esc', key: TerminalKey.escape),
|
||||
VirtualKey('Alt', key: TerminalKey.alt, toggleable: true),
|
||||
VirtualKey('Home', key: TerminalKey.home),
|
||||
|
||||
Reference in New Issue
Block a user