1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 04:49:21 +00:00

Add download link on deprecation dialog

This commit is contained in:
Pierre HUBERT 2021-02-20 09:59:21 +01:00
parent a32e968992
commit 1ea286f3ef
3 changed files with 22 additions and 2 deletions

View File

@ -24,6 +24,8 @@ class ServerConfigurationHelper {
minSupportedMobileVersion:
Version.parse(response["min_supported_mobile_version"]),
termsURL: response["terms_url"],
playStoreURL: response["play_store_url"],
androidDirectDownloadURL: response["android_direct_download_url"],
passwordPolicy: PasswordPolicy(
allowMailInPassword: passwordPolicy["allow_email_in_password"],
allowNameInPassword: passwordPolicy["allow_name_in_password"],

View File

@ -60,16 +60,22 @@ class ServerDataConservationPolicy {
class ServerConfig {
final Version minSupportedMobileVersion;
final String termsURL;
final String playStoreURL;
final String androidDirectDownloadURL;
final PasswordPolicy passwordPolicy;
final ServerDataConservationPolicy dataConservationPolicy;
const ServerConfig({
@required this.minSupportedMobileVersion,
@required this.termsURL,
@required this.playStoreURL,
@required this.androidDirectDownloadURL,
@required this.passwordPolicy,
@required this.dataConservationPolicy,
}) : assert(minSupportedMobileVersion != null),
assert(termsURL != null),
assert(playStoreURL != null),
assert(androidDirectDownloadURL != null),
assert(passwordPolicy != null),
assert(dataConservationPolicy != null);
}

View File

@ -1,5 +1,7 @@
import 'package:comunic/helpers/server_config_helper.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
/// Deprecation dialog
///
@ -16,11 +18,21 @@ class _DeprecationDialog extends StatelessWidget {
return AlertDialog(
title: Text(tr("Deprecated application version")),
content: Text(tr(
"This version of the mobile application is deprecated. You might still be able to use it, but some features will not work. We recommend you to update to the latest version of the application.")),
"This version of the Comunic application is deprecated. You might still be able to use it, but some features may not work. We recommend you to update to the latest version of the application.")),
actions: [
MaterialButton(
onPressed: () =>
launch(ServerConfigurationHelper.config.playStoreURL),
child: Text(tr("Go to the Play Store")),
),
MaterialButton(
onPressed: () =>
launch(ServerConfigurationHelper.config.androidDirectDownloadURL),
child: Text(tr("Download update outside Play Store")),
),
MaterialButton(
onPressed: () => Navigator.pop(context),
child: Text(tr("OK")),
child: Text(tr("Use the old application anyway")),
)
],
);