1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-29 06:18:51 +00:00
comunicmobile/lib/ui/routes/account_settings/account_settings_route.dart

71 lines
2.1 KiB
Dart
Raw Normal View History

2020-04-16 14:33:44 +00:00
import 'package:comunic/ui/routes/account_settings/account_image_settings.dart';
2020-04-29 11:44:09 +00:00
import 'package:comunic/ui/routes/account_settings/custom_emojies_account_settings.dart';
2020-04-27 11:27:37 +00:00
import 'package:comunic/ui/routes/account_settings/general_account_settings.dart';
2020-04-16 14:33:44 +00:00
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: [
2020-04-28 17:03:23 +00:00
// General settings
2020-04-27 11:27:37 +00:00
SettingsTile(
title: tr("General settings"),
subtitle: tr("Configure the main settings of your account"),
leading: Icon(Icons.settings),
onTap: () => _openSection(GeneralAccountSettingsScreen()),
),
2020-04-28 17:03:23 +00:00
// Emoticons
SettingsTile(
title: tr("Custom emojis"),
subtitle: tr("Set your own emoticon shorcuts"),
leading: Icon(Icons.insert_emoticon),
2020-04-29 11:44:09 +00:00
onTap: () => _openSection(CustomEmojisAccountSettings()),
2020-04-28 17:03:23 +00:00
),
// Account image
2020-04-16 14:33:44 +00:00
SettingsTile(
title: tr("Account image"),
subtitle: tr("Customize your account image"),
leading: Icon(Icons.account_circle),
2020-04-16 17:16:44 +00:00
onTap: () => _openSection(AccountImageSettingsScreen()),
2020-04-16 14:33:44 +00:00
)
],
)
],
);
}
/// Open a settings setings
void _openSection(Widget w) {
Navigator.of(context).push(MaterialPageRoute(builder: (c) => w));
}
}