2021-04-30 16:55:45 +00:00
|
|
|
import 'package:comunic/helpers/server_config_helper.dart';
|
|
|
|
import 'package:comunic/ui/widgets/copy_icon.dart';
|
|
|
|
import 'package:comunic/utils/flutter_utils.dart';
|
|
|
|
import 'package:comunic/utils/intl_utils.dart';
|
|
|
|
import 'package:comunic/utils/ui_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2021-12-28 14:23:08 +00:00
|
|
|
import 'package:flutter_settings_ui/flutter_settings_ui.dart';
|
2021-04-30 16:55:45 +00:00
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
/// About application settings
|
|
|
|
///
|
|
|
|
/// @author Pierre Hubert
|
|
|
|
|
|
|
|
class AboutApplicationSettings extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) => SettingsList(
|
|
|
|
sections: [
|
|
|
|
_buildGeneralSection(context),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
|
|
|
|
/// General section
|
|
|
|
SettingsSection _buildGeneralSection(BuildContext context) => SettingsSection(
|
|
|
|
tiles: [
|
|
|
|
SettingsTile(
|
|
|
|
title: tr("Privacy policy"),
|
2022-03-10 18:39:57 +00:00
|
|
|
onPressed: (c) => launch(srvConfig!.privacyPolicyURL),
|
2021-04-30 16:55:45 +00:00
|
|
|
),
|
|
|
|
SettingsTile(
|
|
|
|
title: tr("Terms of Use"),
|
2022-03-10 18:39:57 +00:00
|
|
|
onPressed: (c) => launch(srvConfig!.termsURL),
|
2021-04-30 16:55:45 +00:00
|
|
|
),
|
|
|
|
SettingsTile(
|
|
|
|
title: tr("Contact us"),
|
2022-03-10 18:39:57 +00:00
|
|
|
subtitle: srvConfig!.contactEmail,
|
|
|
|
trailing: CopyIcon(srvConfig!.contactEmail),
|
2021-04-30 16:55:45 +00:00
|
|
|
),
|
|
|
|
SettingsTile(
|
|
|
|
title: tr("About this application"),
|
|
|
|
subtitle: isIOS ? null : tr("Learn more about us"),
|
|
|
|
onPressed: (_) => showAboutAppDialog(context),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|