1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 14:29:22 +00:00
comunicmobile/lib/ui/routes/settings/about_settings.dart

46 lines
1.5 KiB
Dart
Raw Normal View History

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';
2022-06-11 13:04:11 +00:00
import 'package:url_launcher/url_launcher_string.dart';
2021-04-30 16:55:45 +00:00
/// 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-06-11 13:04:11 +00:00
onPressed: (c) => launchUrlString(srvConfig!.privacyPolicyURL),
2021-04-30 16:55:45 +00:00
),
SettingsTile(
title: tr("Terms of Use"),
2022-06-11 13:04:11 +00:00
onPressed: (c) => launchUrlString(srvConfig!.termsURL),
2021-04-30 16:55:45 +00:00
),
SettingsTile(
title: tr("Contact us"),
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),
)
],
);
}