chore: Adjust design of navrail
This commit is contained in:
parent
7be2d3df59
commit
727e442c94
6 changed files with 226 additions and 256 deletions
|
|
@ -1,11 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||
import 'package:fluffychat/pages/chat_list/start_chat_fab.dart';
|
||||
import 'package:fluffychat/widgets/navigation_rail.dart';
|
||||
import 'chat_list_body.dart';
|
||||
|
||||
|
|
@ -48,16 +46,10 @@ class ChatListView extends StatelessWidget {
|
|||
child: Scaffold(
|
||||
body: ChatListViewBody(controller),
|
||||
floatingActionButton:
|
||||
!controller.isSearchMode && controller.activeSpaceId == null
|
||||
? FloatingActionButton(
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
foregroundColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.onPrimary,
|
||||
onPressed: () => context.go('/rooms/newprivatechat'),
|
||||
tooltip: L10n.of(context).newChat,
|
||||
child: const Icon(Icons.edit_square),
|
||||
)
|
||||
!controller.isSearchMode &&
|
||||
controller.activeSpaceId == null &&
|
||||
!FluffyThemes.isColumnMode(context)
|
||||
? StartChatFab()
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
21
lib/pages/chat_list/start_chat_fab.dart
Normal file
21
lib/pages/chat_list/start_chat_fab.dart
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
|
||||
class StartChatFab extends StatelessWidget {
|
||||
const StartChatFab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FloatingActionButton(
|
||||
heroTag: 'start_chat_fab',
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
foregroundColor: Theme.of(context).colorScheme.onPrimary,
|
||||
onPressed: () => context.go('/rooms/newprivatechat'),
|
||||
tooltip: L10n.of(context).newChat,
|
||||
child: const Icon(Icons.edit_square),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue