Initial release date support

This commit is contained in:
Imran Remtulla
2023-02-18 20:37:30 -05:00
parent ea81b0e66e
commit 191776d0d5
12 changed files with 209 additions and 66 deletions

View File

@@ -144,6 +144,13 @@ class _AppPageState extends State<AppPage> {
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.labelSmall,
),
app?.app.releaseDate == null
? const SizedBox.shrink()
: Text(
app!.app.releaseDate.toString(),
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.labelSmall,
),
const SizedBox(
height: 32,
),
@@ -286,6 +293,37 @@ class _AppPageState extends State<AppPage> {
tr('appsFromSourceAreTrackOnly'),
context);
}
if (changedApp.additionalSettings[
'releaseDateAsVersion'] ==
true) {
changedApp.additionalSettings[
'noVersionDetection'] = true;
if (app.app.additionalSettings[
'releaseDateAsVersion'] !=
true) {
if (app.app.releaseDate != null) {
changedApp.latestVersion = app
.app
.releaseDate!
.microsecondsSinceEpoch
.toString();
if (app.app.installedVersion ==
app.app.latestVersion) {
changedApp.installedVersion =
changedApp.latestVersion;
}
}
}
} else if (app.app.additionalSettings[
'releaseDateAsVersion'] ==
true) {
changedApp.additionalSettings[
'noVersionDetection'] = false;
changedApp.installedVersion = app
.installedInfo
?.versionName ??
changedApp.installedVersion;
}
appsProvider.saveApps(
[changedApp]).then((value) {
getUpdate(changedApp.id);