From 3cf114003941ecfc5f2ecca870029bc17aeb2dda Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:21:46 -0500 Subject: [PATCH] added version numbers to update dialog (#1244) --- assets/l10n/intl_en.arb | 4 +++- .../controllers/app_version_controller.dart | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 818a5b526..b7ea7a874 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -4628,5 +4628,7 @@ "enableTTSToolName": "Enabled text-to-speech", "enableTTSToolDescription": "Allow the app to generate text-to-speech output for portions of text in your target language", "couldNotFindTTS": "We couldn't find a text-to-speech engine for your current target language. ", - "ttsInstructionsHyperlink": "Click here to view instructions for downloading a new voice on your device." + "ttsInstructionsHyperlink": "Click here to view instructions for downloading a new voice on your device.", + "currentVersion": "Current Version", + "latestVersion": "Latest Version" } diff --git a/lib/pangea/controllers/app_version_controller.dart b/lib/pangea/controllers/app_version_controller.dart index 5095b1618..836dcbcd2 100644 --- a/lib/pangea/controllers/app_version_controller.dart +++ b/lib/pangea/controllers/app_version_controller.dart @@ -128,8 +128,14 @@ class AppVersionController { return; } - final OkCancelResult dialogResponse = - await _showDialog(context, mandatoryUpdate); + final OkCancelResult dialogResponse = await _showDialog( + context, + mandatoryUpdate, + currentVersion, + remoteVersion, + currentBuildNumber, + remoteBuildNumber, + ); if (!mandatoryUpdate && dialogResponse != OkCancelResult.ok) { await MatrixState.pangeaController.pStoreService.save( @@ -146,13 +152,21 @@ class AppVersionController { static Future _showDialog( BuildContext context, bool mandatoryUpdate, + String currentVersion, + String remoteVersion, + String currentBuildNumber, + String remoteBuildNumber, ) async { final title = mandatoryUpdate ? L10n.of(context).mandatoryUpdateRequired : L10n.of(context).updateAvailable; final message = mandatoryUpdate - ? L10n.of(context).mandatoryUpdateRequiredDesc - : L10n.of(context).updateAvailableDesc; + ? "${L10n.of(context).mandatoryUpdateRequiredDesc}\n\n" + "${L10n.of(context).currentVersion}: $currentVersion+$currentBuildNumber\n" + "${L10n.of(context).latestVersion}: $remoteVersion+$remoteBuildNumber" + : "${L10n.of(context).updateAvailableDesc}\n\n" + "${L10n.of(context).currentVersion}: $currentVersion+$currentBuildNumber\n" + "${L10n.of(context).latestVersion}: $remoteVersion+$remoteBuildNumber"; return mandatoryUpdate ? showOkAlertDialog( context: context,