1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 06:19:22 +00:00
comunicmobile/lib/ui/dialogs/deprecation_dialog.dart

41 lines
1.4 KiB
Dart
Raw Normal View History

import 'package:comunic/helpers/server_config_helper.dart';
2021-02-20 08:24:51 +00:00
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
2021-02-20 08:24:51 +00:00
/// Deprecation dialog
///
/// @author Pierre Hubert
/// Show a dialog to warn the user this version of the application is deprecated
Future<void> showDeprecationDialog(BuildContext context) async {
await showDialog(context: context, builder: (c) => _DeprecationDialog());
}
class _DeprecationDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(tr("Deprecated application version")),
content: Text(tr(
"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.")),
2021-02-20 08:24:51 +00:00
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")),
),
2021-02-20 08:24:51 +00:00
MaterialButton(
onPressed: () => Navigator.pop(context),
child: Text(tr("Use the old application anyway")),
2021-02-20 08:24:51 +00:00
)
],
);
}
}