chore: Design follow up fixes

This commit is contained in:
Christian Pauly 2022-07-08 15:42:47 +02:00
parent e129e3ecaf
commit 7ad2359214
7 changed files with 70 additions and 43 deletions

View File

@ -59,7 +59,6 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
child = Column(
key: const ValueKey(null),
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset(
'assets/private_chat_wallpaper.png',
@ -76,6 +75,7 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
),
),
),
const SizedBox(height: 160),
],
);
} else {
@ -96,7 +96,10 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
children: [
const ConnectionStatusHeader(),
if (roomSearchResult != null) ...[
_SearchTitle(title: L10n.of(context)!.publicRooms),
_SearchTitle(
title: L10n.of(context)!.publicRooms,
icon: Icons.explore_outlined,
),
AnimatedContainer(
height: roomSearchResult.chunk.isEmpty ? 0 : 106,
duration: const Duration(milliseconds: 250),
@ -126,7 +129,10 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
),
],
if (userSearchResult != null) ...[
_SearchTitle(title: L10n.of(context)!.users),
_SearchTitle(
title: L10n.of(context)!.users,
icon: Icons.group_outlined,
),
AnimatedContainer(
height: userSearchResult.results.isEmpty ? 0 : 106,
duration: const Duration(milliseconds: 250),
@ -152,7 +158,10 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
),
],
if (widget.controller.isSearchMode)
_SearchTitle(title: L10n.of(context)!.stories),
_SearchTitle(
title: L10n.of(context)!.stories,
icon: Icons.camera_alt_outlined,
),
StoriesHeader(
filter: widget.controller.searchController.text,
),
@ -198,7 +207,10 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
),
),
if (widget.controller.isSearchMode)
_SearchTitle(title: L10n.of(context)!.chats),
_SearchTitle(
title: L10n.of(context)!.chats,
icon: Icons.chat_outlined,
),
],
);
}
@ -336,7 +348,12 @@ class _ChatListViewBodyState extends State<ChatListViewBody> {
class _SearchTitle extends StatelessWidget {
final String title;
const _SearchTitle({required this.title, Key? key}) : super(key: key);
final IconData icon;
const _SearchTitle({
required this.title,
required this.icon,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) => Container(
@ -355,13 +372,19 @@ class _SearchTitle extends StatelessWidget {
horizontal: 16,
vertical: 8,
),
child: Text(title,
textAlign: TextAlign.left,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.bold,
)),
child: Row(
children: [
Icon(icon, size: 16),
const SizedBox(width: 16),
Text(title,
textAlign: TextAlign.left,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontSize: 12,
fontWeight: FontWeight.bold,
)),
],
),
),
),
);

View File

@ -6,7 +6,9 @@ import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/pages/chat_list/chat_list.dart';
import 'package:fluffychat/pages/chat_list/spaces_drawer.dart';
import 'package:fluffychat/utils/fluffy_share.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/matrix.dart';
import '../../config/app_config.dart';
class ChatListDrawer extends StatelessWidget {
final ChatListController controller;
@ -17,12 +19,20 @@ class ChatListDrawer extends StatelessWidget {
child: SafeArea(
child: Column(
children: [
ListTile(
leading: const CircleAvatar(
radius: Avatar.defaultSize / 2,
backgroundImage: AssetImage('assets/logo.png'),
),
title: Text(AppConfig.applicationName),
),
const Divider(thickness: 1),
Expanded(
child: SpacesDrawer(
controller: controller,
),
),
const Divider(),
const Divider(thickness: 1),
ListTile(
leading: Icon(
Icons.group_add_outlined,
@ -34,6 +44,17 @@ class ChatListDrawer extends StatelessWidget {
VRouter.of(context).to('/newgroup');
},
),
ListTile(
leading: Icon(
Icons.group_work_outlined,
color: Theme.of(context).colorScheme.onBackground,
),
title: Text(L10n.of(context)!.createNewSpace),
onTap: () {
Scaffold.of(context).closeDrawer();
VRouter.of(context).to('/newspace');
},
),
ListTile(
leading: Icon(
Icons.adaptive.share_outlined,

View File

@ -17,7 +17,6 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
final selectMode = controller.selectMode;
return AppBar(
titleSpacing: 8,
automaticallyImplyLeading: false,
leading: selectMode == SelectMode.normal
? null
@ -47,7 +46,7 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
borderRadius: BorderRadius.circular(90),
borderSide: BorderSide.none,
),
hintText: L10n.of(context)!.search,
hintText: controller.activeSpacesEntry.getName(context),
prefixIcon: controller.isSearchMode
? IconButton(
tooltip: L10n.of(context)!.cancel,

View File

@ -24,15 +24,14 @@ class SpacesDrawer extends StatelessWidget {
// TODO(TheOeWithTheBraid): wait for space hierarchy https://gitlab.com/famedly/company/frontend/libraries/matrix_api_lite/-/merge_requests/58
return ListView.builder(
itemCount: spaceHierarchy.length + 2,
itemCount: spaceHierarchy.length + 1,
itemBuilder: (context, i) {
if (i == spaceHierarchy.length) {
return ListTile(
leading: CircleAvatar(
radius: Avatar.defaultSize / 2,
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onSecondaryContainer,
backgroundColor: Theme.of(context).colorScheme.secondary,
foregroundColor: Theme.of(context).colorScheme.onSecondary,
child: const Icon(
Icons.archive_outlined,
),
@ -44,22 +43,6 @@ class SpacesDrawer extends StatelessWidget {
},
);
}
if (i == spaceHierarchy.length + 1) {
return ListTile(
leading: CircleAvatar(
child: const Icon(Icons.group_work_outlined),
radius: Avatar.defaultSize / 2,
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onSecondaryContainer,
),
title: Text(L10n.of(context)!.createNewSpace),
onTap: () {
Scaffold.of(context).closeDrawer();
VRouter.of(context).to('/newspace');
},
);
}
final space = spaceHierarchy.keys.toList()[i];
final room = space.getSpace(context);
final active = currentIndex == i;
@ -69,10 +52,8 @@ class SpacesDrawer extends StatelessWidget {
? CircleAvatar(
child: space.getIcon(active),
radius: Avatar.defaultSize / 2,
backgroundColor:
Theme.of(context).colorScheme.secondaryContainer,
foregroundColor:
Theme.of(context).colorScheme.onSecondaryContainer,
backgroundColor: Theme.of(context).colorScheme.secondary,
foregroundColor: Theme.of(context).colorScheme.onSecondary,
)
: Avatar(
mxContent: room.avatar,
@ -107,7 +88,7 @@ class SpacesDrawer extends StatelessWidget {
onPressed: () => controller.editSpace(context, room.id),
),
)
: null,
: const Icon(Icons.arrow_forward_ios_outlined),
);
},
);

View File

@ -121,7 +121,7 @@ class StoriesHeader extends StatelessWidget {
return SizedBox(
height: 98,
child: ListView.builder(
padding: const EdgeInsets.symmetric(horizontal: 2),
padding: const EdgeInsets.symmetric(horizontal: 8),
scrollDirection: Axis.horizontal,
itemCount: stories.length,
itemBuilder: (context, i) {

View File

@ -349,6 +349,7 @@ class StoryView extends StatelessWidget {
onPressed: controller.replyAction,
icon: const Icon(Icons.send_outlined),
),
fillColor: Theme.of(context).colorScheme.background,
),
),
),

View File

@ -128,7 +128,9 @@ class UserBottomSheetView extends StatelessWidget {
subtitle: Text(user.id),
trailing: Icon(Icons.adaptive.share_outlined),
onTap: () => FluffyShare.share(
user.id, controller.widget.outerContext),
user.id,
context,
),
),
if (presence != null)
ListTile(