fluffychat/lib/pages/views/settings_chat_view.dart

73 lines
2.7 KiB
Dart
Raw Normal View History

2021-10-26 16:50:34 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:vrouter/vrouter.dart';
2021-06-23 09:26:12 +00:00
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/setting_keys.dart';
2021-08-24 18:43:21 +00:00
import 'package:fluffychat/utils/platform_infos.dart';
2021-06-23 09:26:12 +00:00
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
import 'package:fluffychat/widgets/settings_switch_list_tile.dart';
import '../settings_chat.dart';
class SettingsChatView extends StatelessWidget {
final SettingsChatController controller;
const SettingsChatView(this.controller, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(L10n.of(context).chat)),
body: MaxWidthBody(
withScrolling: true,
child: Column(
children: [
ListTile(
title: Text(L10n.of(context).changeTheme),
2021-07-08 15:10:20 +00:00
onTap: () => VRouter.of(context).to('style'),
2021-10-14 16:09:30 +00:00
trailing: const Icon(Icons.style_outlined),
2021-06-23 09:26:12 +00:00
),
ListTile(
title: Text(L10n.of(context).emoteSettings),
2021-07-08 15:10:20 +00:00
onTap: () => VRouter.of(context).to('emotes'),
2021-10-14 16:09:30 +00:00
trailing: const Icon(Icons.insert_emoticon_outlined),
2021-06-23 09:26:12 +00:00
),
2021-10-14 16:09:30 +00:00
const Divider(height: 1),
2021-06-23 09:26:12 +00:00
SettingsSwitchListTile(
title: L10n.of(context).renderRichContent,
onChanged: (b) => AppConfig.renderHtml = b,
storeKey: SettingKeys.renderHtml,
defaultValue: AppConfig.renderHtml,
),
SettingsSwitchListTile(
title: L10n.of(context).hideRedactedEvents,
onChanged: (b) => AppConfig.hideRedactedEvents = b,
storeKey: SettingKeys.hideRedactedEvents,
defaultValue: AppConfig.hideRedactedEvents,
),
SettingsSwitchListTile(
title: L10n.of(context).hideUnknownEvents,
onChanged: (b) => AppConfig.hideUnknownEvents = b,
storeKey: SettingKeys.hideUnknownEvents,
defaultValue: AppConfig.hideUnknownEvents,
),
SettingsSwitchListTile(
title: L10n.of(context).autoplayImages,
onChanged: (b) => AppConfig.autoplayImages = b,
storeKey: SettingKeys.autoplayImages,
defaultValue: AppConfig.autoplayImages,
),
2021-08-24 18:43:21 +00:00
if (PlatformInfos.isMobile)
SettingsSwitchListTile(
title: L10n.of(context).sendOnEnter,
onChanged: (b) => AppConfig.sendOnEnter = b,
storeKey: SettingKeys.sendOnEnter,
defaultValue: AppConfig.sendOnEnter,
),
2021-06-23 09:26:12 +00:00
],
),
),
);
}
}