feat: add equality operators, make history screen paginated, random performance updates
This commit is contained in:
@@ -0,0 +1 @@
|
||||
const kUpdateServerUrl = 'https://updater.brammie15.dev';
|
||||
@@ -36,6 +36,21 @@ class UpdateInfo {
|
||||
download: json["download"] ?? "",
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is UpdateInfo &&
|
||||
update == other.update &&
|
||||
version == other.version &&
|
||||
notes == other.notes &&
|
||||
mandatory == other.mandatory &&
|
||||
sha256 == other.sha256 &&
|
||||
download == other.download;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(update, version, notes, mandatory, sha256, download);
|
||||
}
|
||||
|
||||
class AppUpdateUtil {
|
||||
|
||||
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:kooltab2/utils/app_update_util.dart';
|
||||
import 'package:ota_update/ota_update.dart';
|
||||
|
||||
import 'app_config.dart';
|
||||
|
||||
class UpdateChecker {
|
||||
static bool _hasChecked = false;
|
||||
|
||||
@@ -13,7 +15,7 @@ class UpdateChecker {
|
||||
|
||||
_hasChecked = true;
|
||||
|
||||
final updater = AppUpdateUtil(serverUrl: "https://updater.brammie15.dev");
|
||||
final updater = AppUpdateUtil(serverUrl: kUpdateServerUrl);
|
||||
|
||||
try {
|
||||
final update = await updater.checkForUpdate();
|
||||
@@ -72,7 +74,7 @@ Future<void> _downloadAndInstall(UpdateInfo update) async {
|
||||
try {
|
||||
final url = update.download.startsWith("http")
|
||||
? update.download
|
||||
: "https://updater.brammie15.dev${update.download}";
|
||||
: "$kUpdateServerUrl${update.download}";
|
||||
OtaUpdate()
|
||||
.execute(
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user