mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 21:15:37 +02:00
feat: Show a dialog when an update is available (#1654)
This commit is contained in:
parent
7104d6d6dd
commit
c7d975e612
10 changed files with 302 additions and 190 deletions
|
@ -128,12 +128,12 @@ class ManagerAPI {
|
|||
await _prefs.setString('patchesRepo', value);
|
||||
}
|
||||
|
||||
bool getPatchesConsent() {
|
||||
return _prefs.getBool('patchesConsent') ?? false;
|
||||
bool getDownloadConsent() {
|
||||
return _prefs.getBool('downloadConsent') ?? false;
|
||||
}
|
||||
|
||||
Future<void> setPatchesConsent(bool consent) async {
|
||||
await _prefs.setBool('patchesConsent', consent);
|
||||
void setDownloadConsent(bool consent) {
|
||||
_prefs.setBool('downloadConsent', consent);
|
||||
}
|
||||
|
||||
bool isPatchesAutoUpdate() {
|
||||
|
@ -156,6 +156,14 @@ class ManagerAPI {
|
|||
_prefs.setBool('showPatchesChangeWarning', !value);
|
||||
}
|
||||
|
||||
bool showUpdateDialog() {
|
||||
return _prefs.getBool('showUpdateDialog') ?? true;
|
||||
}
|
||||
|
||||
void setShowUpdateDialog(bool value) {
|
||||
_prefs.setBool('showUpdateDialog', value);
|
||||
}
|
||||
|
||||
bool isChangingToggleModified() {
|
||||
return _prefs.getBool('isChangingToggleModified') ?? false;
|
||||
}
|
||||
|
@ -164,8 +172,8 @@ class ManagerAPI {
|
|||
_prefs.setBool('isChangingToggleModified', value);
|
||||
}
|
||||
|
||||
Future<void> setPatchesAutoUpdate(bool value) async {
|
||||
await _prefs.setBool('patchesAutoUpdate', value);
|
||||
void setPatchesAutoUpdate(bool value) {
|
||||
_prefs.setBool('patchesAutoUpdate', value);
|
||||
}
|
||||
|
||||
List<Patch> getSavedPatches(String packageName) {
|
||||
|
@ -508,7 +516,11 @@ class ManagerAPI {
|
|||
|
||||
Future<String> getCurrentManagerVersion() async {
|
||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
return packageInfo.version;
|
||||
String version = packageInfo.version;
|
||||
if (!version.startsWith('v')) {
|
||||
version = 'v$version';
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
Future<String> getCurrentPatchesVersion() async {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue