From c4c594adf1080a09335ff7e010f30f5cb64bb227 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 8 Jul 2022 10:13:44 +0200 Subject: [PATCH] chore: Minor design improvements --- lib/pages/chat_details/chat_details_view.dart | 10 ++++++---- lib/pages/chat_list/chat_list.dart | 2 +- lib/pages/settings/settings_view.dart | 2 +- .../user_bottom_sheet_view.dart | 2 +- lib/widgets/content_banner.dart | 18 ++++++++++++++---- lib/widgets/profile_bottom_sheet.dart | 2 +- lib/widgets/public_room_bottom_sheet.dart | 2 +- 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart index f457b5c85..116c4fa7f 100644 --- a/lib/pages/chat_details/chat_details_view.dart +++ b/lib/pages/chat_details/chat_details_view.dart @@ -81,10 +81,12 @@ class ChatDetailsView extends StatelessWidget { Theme.of(context).appBarTheme.backgroundColor, flexibleSpace: FlexibleSpaceBar( background: ContentBanner( - mxContent: room.avatar, - onEdit: room.canSendEvent('m.room.avatar') - ? controller.setAvatarAction - : null), + mxContent: room.avatar, + onEdit: room.canSendEvent('m.room.avatar') + ? controller.setAvatarAction + : null, + defaultIcon: Icons.group_outlined, + ), ), ), ], diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 8385a5ac5..825c5f090 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -163,7 +163,7 @@ class ChatListController extends State with TickerProviderStateMixin { Stream get clientStream => _clientStream.stream; - void addAccountAction() => VRouter.of(context).to('/settings/account/add'); + void addAccountAction() => VRouter.of(context).to('/settings/account'); void _onScroll() { final newScrolledToTop = scrollController.position.pixels <= 0; diff --git a/lib/pages/settings/settings_view.dart b/lib/pages/settings/settings_view.dart index 0283ab53e..242c247c8 100644 --- a/lib/pages/settings/settings_view.dart +++ b/lib/pages/settings/settings_view.dart @@ -31,7 +31,7 @@ class SettingsView extends StatelessWidget { background: ContentBanner( mxContent: controller.profile?.avatarUrl, onEdit: controller.setAvatarAction, - defaultIcon: Icons.person_outline_outlined, + defaultIcon: Icons.account_circle_outlined, ), ), ), diff --git a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart index 9dbb33c0e..a4c04bd0e 100644 --- a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart +++ b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart @@ -119,7 +119,7 @@ class UserBottomSheetView extends StatelessWidget { Expanded( child: ContentBanner( mxContent: user.avatarUrl, - defaultIcon: Icons.person_outline, + defaultIcon: Icons.account_circle_outlined, client: client, ), ), diff --git a/lib/widgets/content_banner.dart b/lib/widgets/content_banner.dart index d58c32bea..2cdda5865 100644 --- a/lib/widgets/content_banner.dart +++ b/lib/widgets/content_banner.dart @@ -19,7 +19,7 @@ class ContentBanner extends StatelessWidget { const ContentBanner( {this.mxContent, this.height = 400, - this.defaultIcon = Icons.people_outlined, + this.defaultIcon = Icons.account_circle_outlined, this.loading = false, this.onEdit, this.client, @@ -34,7 +34,7 @@ class ContentBanner extends StatelessWidget { height: height, alignment: Alignment.center, decoration: BoxDecoration( - color: Theme.of(context).secondaryHeaderColor, + color: Theme.of(context).colorScheme.secondaryContainer, ), child: Stack( children: [ @@ -66,10 +66,20 @@ class ContentBanner extends StatelessWidget { imageUrl: src.toString(), height: 300, fit: BoxFit.cover, - errorWidget: (c, m, e) => Icon(defaultIcon, size: 200), + errorWidget: (c, m, e) => Icon( + defaultIcon, + size: 200, + color: Theme.of(context) + .colorScheme + .onSecondaryContainer, + ), ); }) - : Icon(defaultIcon, size: 200), + : Icon( + defaultIcon, + size: 200, + color: Theme.of(context).colorScheme.onSecondaryContainer, + ), ), ), if (onEdit != null) diff --git a/lib/widgets/profile_bottom_sheet.dart b/lib/widgets/profile_bottom_sheet.dart index 8532b9687..6ab03a490 100644 --- a/lib/widgets/profile_bottom_sheet.dart +++ b/lib/widgets/profile_bottom_sheet.dart @@ -76,7 +76,7 @@ class ProfileBottomSheet extends StatelessWidget { ) : ContentBanner( mxContent: profile.avatarUrl, - defaultIcon: Icons.person_outline, + defaultIcon: Icons.account_circle_outlined, client: Matrix.of(context).client, ), ), diff --git a/lib/widgets/public_room_bottom_sheet.dart b/lib/widgets/public_room_bottom_sheet.dart index 414702dc1..40b9d5544 100644 --- a/lib/widgets/public_room_bottom_sheet.dart +++ b/lib/widgets/public_room_bottom_sheet.dart @@ -114,7 +114,7 @@ class PublicRoomBottomSheet extends StatelessWidget { ContentBanner( mxContent: profile.avatarUrl, height: 156, - defaultIcon: Icons.person_outline, + defaultIcon: Icons.group_outlined, client: Matrix.of(context).client, ), ListTile(