Add option to disable chat bottom bar

This commit is contained in:
tommyxchow 2022-01-23 14:32:30 -05:00
parent a7856186bc
commit 76b42a96d9
4 changed files with 28 additions and 1 deletions

View file

@ -97,7 +97,7 @@ class Chat extends StatelessWidget {
),
),
),
ChatBottomBar(chatStore: chatStore),
if (chatStore.settings.showBottomBar) ChatBottomBar(chatStore: chatStore),
if (chatStore.assetsStore.showEmoteMenu)
SizedBox(
height: MediaQuery.of(context).size.height / 3,

View file

@ -28,6 +28,11 @@ class _ChatSettingsState extends State<ChatSettings> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SectionHeader('Chat'),
SwitchListTile.adaptive(
title: const Text('Show bottom bar'),
value: settingsStore.showBottomBar,
onChanged: (newValue) => settingsStore.showBottomBar = newValue,
),
SwitchListTile.adaptive(
title: const Text('Show deleted messages'),
value: settingsStore.showDeletedMessages,

View file

@ -39,6 +39,10 @@ abstract class _SettingsStoreBase with Store {
var pictureInPicture = false;
// Chat Settings
@JsonKey(defaultValue: true)
@observable
var showBottomBar = true;
@JsonKey(defaultValue: false)
@observable
var showDeletedMessages = false;

View file

@ -16,6 +16,7 @@ SettingsStore _$SettingsStoreFromJson(Map<String, dynamic> json) =>
..showOverlay = json['showOverlay'] as bool? ?? true
..toggleableOverlay = json['toggleableOverlay'] as bool? ?? false
..pictureInPicture = json['pictureInPicture'] as bool? ?? false
..showBottomBar = json['showBottomBar'] as bool? ?? true
..showDeletedMessages = json['showDeletedMessages'] as bool? ?? false
..showZeroWidth = json['showZeroWidth'] as bool? ?? false
..timestampType = $enumDecodeNullable(
@ -40,6 +41,7 @@ Map<String, dynamic> _$SettingsStoreToJson(SettingsStore instance) =>
'showOverlay': instance.showOverlay,
'toggleableOverlay': instance.toggleableOverlay,
'pictureInPicture': instance.pictureInPicture,
'showBottomBar': instance.showBottomBar,
'showDeletedMessages': instance.showDeletedMessages,
'showZeroWidth': instance.showZeroWidth,
'timestampType': _$TimestampTypeEnumMap[instance.timestampType],
@ -167,6 +169,21 @@ mixin _$SettingsStore on _SettingsStoreBase, Store {
});
}
final _$showBottomBarAtom = Atom(name: '_SettingsStoreBase.showBottomBar');
@override
bool get showBottomBar {
_$showBottomBarAtom.reportRead();
return super.showBottomBar;
}
@override
set showBottomBar(bool value) {
_$showBottomBarAtom.reportWrite(value, super.showBottomBar, () {
super.showBottomBar = value;
});
}
final _$showDeletedMessagesAtom =
Atom(name: '_SettingsStoreBase.showDeletedMessages');
@ -358,6 +375,7 @@ showVideo: ${showVideo},
showOverlay: ${showOverlay},
toggleableOverlay: ${toggleableOverlay},
pictureInPicture: ${pictureInPicture},
showBottomBar: ${showBottomBar},
showDeletedMessages: ${showDeletedMessages},
showZeroWidth: ${showZeroWidth},
timestampType: ${timestampType},