feat: add setting for whether to show space navigation rail on mobile
This commit is contained in:
parent
12320d4198
commit
4b926935bd
8 changed files with 22 additions and 5 deletions
|
|
@ -165,7 +165,8 @@ class ChatListViewBody extends StatelessWidget {
|
|||
ActiveFilter.groups,
|
||||
ActiveFilter.unread,
|
||||
if (spaceDelegateCandidates.isNotEmpty &&
|
||||
!controller.widget.displayNavigationRail)
|
||||
!AppConfig.displayNavigationRail &&
|
||||
!FluffyThemes.isColumnMode(context))
|
||||
ActiveFilter.spaces,
|
||||
]
|
||||
.map(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/widgets/navigation_rail.dart';
|
||||
|
|
@ -30,8 +31,8 @@ class ChatListView extends StatelessWidget {
|
|||
},
|
||||
child: Row(
|
||||
children: [
|
||||
if (FluffyThemes.isColumnMode(context) &&
|
||||
controller.widget.displayNavigationRail) ...[
|
||||
if (FluffyThemes.isColumnMode(context) ||
|
||||
AppConfig.displayNavigationRail) ...[
|
||||
SpacesNavigationRail(
|
||||
activeSpaceId: controller.activeSpaceId,
|
||||
onGoToChats: controller.clearActiveSpace,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ class SettingsView extends StatelessWidget {
|
|||
?.tryGet<String>('account');
|
||||
return Row(
|
||||
children: [
|
||||
if (FluffyThemes.isColumnMode(context)) ...[
|
||||
if (FluffyThemes.isColumnMode(context) ||
|
||||
AppConfig.displayNavigationRail) ...[
|
||||
SpacesNavigationRail(
|
||||
activeSpaceId: null,
|
||||
onGoToChats: () => context.go('/rooms'),
|
||||
|
|
|
|||
|
|
@ -359,6 +359,12 @@ class SettingsStyleView extends StatelessWidget {
|
|||
storeKey: SettingKeys.separateChatTypes,
|
||||
defaultValue: AppConfig.separateChatTypes,
|
||||
),
|
||||
SettingsSwitchListTile.adaptive(
|
||||
title: L10n.of(context).displayNavigationRail,
|
||||
onChanged: (b) => AppConfig.displayNavigationRail = b,
|
||||
storeKey: SettingKeys.displayNavigationRail,
|
||||
defaultValue: AppConfig.displayNavigationRail,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue