1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-30 23:08:50 +00:00
comunicmobile/lib/ui/routes/settings/about_settings.dart

46 lines
1.4 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';
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"),
onPressed: (c) => launch(srvConfig.privacyPolicyURL),
),
SettingsTile(
title: tr("Terms of Use"),
onPressed: (c) => launch(srvConfig.termsURL),
),
SettingsTile(
title: tr("Contact us"),
subtitle: srvConfig.contactEmail,
trailing: CopyIcon(srvConfig.contactEmail),
),
SettingsTile(
title: tr("About this application"),
subtitle: isIOS ? null : tr("Learn more about us"),
onPressed: (_) => showAboutAppDialog(context),
)
],
);
}