diff --git a/lib/pages/chat_list/chat_list_header.dart b/lib/pages/chat_list/chat_list_header.dart index 9d02de671c..069d065b05 100644 --- a/lib/pages/chat_list/chat_list_header.dart +++ b/lib/pages/chat_list/chat_list_header.dart @@ -22,11 +22,11 @@ class ChatListHeader extends StatelessWidget { switch (selectMode) { case SelectMode.select: - child = selectModeWidgets(context); + child = _selectModeWidgets(context); case SelectMode.normal: - child = normalModeWidgets(context); + child = _normalModeWidgets(context); default: - child = normalModeWidgets(context); + child = _normalModeWidgets(context); } return Column( @@ -41,7 +41,7 @@ class ChatListHeader extends StatelessWidget { ); } - Widget selectModeWidgets(BuildContext context) { + Widget _selectModeWidgets(BuildContext context) { return Row( children: [ IconButton( @@ -92,38 +92,40 @@ class ChatListHeader extends StatelessWidget { ); } - Widget normalModeWidgets(BuildContext context) => Row( - children: [ - Expanded( - child: InkWell( - borderRadius: BorderRadius.circular(24.0), - onTap: onOpenSearchPage, - child: TextField( - controller: controller.searchChatController, - textInputAction: TextInputAction.search, - onChanged: controller.onSearchEnter, - enabled: false, - decoration: InputDecoration( - filled: true, - contentPadding: const EdgeInsets.all(0), - fillColor: Theme.of(context).colorScheme.surface, - border: OutlineInputBorder( - borderSide: BorderSide.none, - borderRadius: BorderRadius.circular( - ChatListHeaderStyle.searchRadiusBorder, - ), - ), - hintText: L10n.of(context)!.search, - floatingLabelBehavior: FloatingLabelBehavior.never, - prefixIcon: Icon( - Icons.search_outlined, - color: Theme.of(context).colorScheme.onBackground, + Widget _normalModeWidgets(BuildContext context) { + return Row( + children: [ + Expanded( + child: InkWell( + borderRadius: BorderRadius.circular(24.0), + onTap: onOpenSearchPage, + child: TextField( + controller: controller.searchChatController, + textInputAction: TextInputAction.search, + onChanged: controller.onSearchEnter, + enabled: false, + decoration: InputDecoration( + filled: true, + contentPadding: const EdgeInsets.all(0), + fillColor: Theme.of(context).colorScheme.surface, + border: OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.circular( + ChatListHeaderStyle.searchRadiusBorder, ), - suffixIcon: const SizedBox.shrink(), ), + hintText: L10n.of(context)!.search, + floatingLabelBehavior: FloatingLabelBehavior.never, + prefixIcon: Icon( + Icons.search_outlined, + color: Theme.of(context).colorScheme.onBackground, + ), + suffixIcon: const SizedBox.shrink(), ), ), ), - ], - ); + ), + ], + ); + } } diff --git a/lib/pages/forward/selectable_chat_list_item.dart b/lib/pages/forward/selectable_chat_list_item.dart index fea3cab933..947f9b7eb7 100644 --- a/lib/pages/forward/selectable_chat_list_item.dart +++ b/lib/pages/forward/selectable_chat_list_item.dart @@ -22,7 +22,6 @@ class SelectableChatListItem extends StatelessWidget { @override Widget build(BuildContext context) { - final unread = room.isUnread || room.membership == Membership.invite; final displayName = room.getLocalizedDisplayname( MatrixLocals(L10n.of(context)!), ); @@ -79,7 +78,8 @@ class SelectableChatListItem extends StatelessWidget { style: Theme.of(context).textTheme.titleMedium?.copyWith( overflow: TextOverflow.ellipsis, letterSpacing: 0.15, - color: unread + color: room.isUnread || + room.membership == Membership.invite ? Theme.of(context).colorScheme.onSurfaceVariant : ChatListItemStyle.readMessageColor, ),