Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! TW-403: add share screen
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn committed Aug 28, 2023
1 parent a75d0a9 commit 4b3cded
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
68 changes: 35 additions & 33 deletions lib/pages/chat_list/chat_list_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -41,7 +41,7 @@ class ChatListHeader extends StatelessWidget {
);
}

Widget selectModeWidgets(BuildContext context) {
Widget _selectModeWidgets(BuildContext context) {
return Row(
children: [
IconButton(
Expand Down Expand Up @@ -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(),
),
),
),
],
);
),
],
);
}
}
4 changes: 2 additions & 2 deletions lib/pages/forward/selectable_chat_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)!),
);
Expand Down Expand Up @@ -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,
),
Expand Down

0 comments on commit 4b3cded

Please sign in to comment.