1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +00:00
comunicmobile/lib/ui/routes/account_settings/account_settings_route.dart

89 lines
2.9 KiB
Dart

import 'package:comunic/ui/routes/account_settings/account_image_settings.dart';
import 'package:comunic/ui/routes/account_settings/account_privacy_settings.dart';
import 'package:comunic/ui/routes/account_settings/account_security_settings.dart';
import 'package:comunic/ui/routes/account_settings/custom_emojies_account_settings.dart';
import 'package:comunic/ui/routes/account_settings/general_account_settings.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
import 'package:settings_ui/settings_ui.dart';
/// Account settings route
///
/// @author Pierre HUBERT
class AccountSettingsRoute extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(tr("Account settings")),
),
body: _AccountSettingsBody(),
);
}
}
class _AccountSettingsBody extends StatefulWidget {
@override
__AccountSettingsBodyState createState() => __AccountSettingsBodyState();
}
class __AccountSettingsBodyState extends State<_AccountSettingsBody> {
@override
Widget build(BuildContext context) {
return SettingsList(
sections: [
SettingsSection(
title: tr("Account settings"),
tiles: [
// General settings
SettingsTile(
title: tr("General settings"),
subtitle: tr("Configure the main settings of your account"),
leading: Icon(Icons.settings),
onTap: () => _openSection(GeneralAccountSettingsScreen()),
),
// Emoticons
SettingsTile(
title: tr("Custom emojis"),
subtitle: tr("Set your own emoticon shorcuts"),
leading: Icon(Icons.insert_emoticon),
onTap: () => _openSection(CustomEmojisAccountSettings()),
),
// Account image
SettingsTile(
title: tr("Account image"),
subtitle: tr("Customize your account image"),
leading: Icon(Icons.account_circle),
onTap: () => _openSection(AccountImageSettingsScreen()),
),
// Security settings
SettingsTile(
title: tr("Security"),
subtitle: tr("Manage security options of your account"),
leading: Icon(Icons.lock),
onTap: () => _openSection(AccountSecuritySettingsScreen()),
),
// Privacy settings
SettingsTile(
title: tr("Privacy"),
subtitle: tr("Here you can make actions to protect your privacy"),
leading: Icon(Icons.security),
onTap: () => _openSection(AccountPrivacySettings()),
),
],
)
],
);
}
/// Open a settings setings
void _openSection(Widget w) {
Navigator.of(context).push(MaterialPageRoute(builder: (c) => w));
}
}