-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hope support for sorting channel list by custom fields #65
Comments
Agent comment from Stephen Hodgetts in Zendesk ticket #4687: |
class ChannelListPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
centerTitle: true,
title: Text(
'Messages',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
),
),
body: ChannelsBloc(
child: ChannelListView(
filter: {
'members': {
'\$in': [StreamChat.of(context).user.id],
}
},
sort: [
SortOption('priority', direction: 1),
SortOption('last_message_at')
],
pagination: PaginationParams(
limit: 20,
),
channelWidget: ChannelPage(),
),
),
);
}
} this is my ChannelListView code. |
hey @yswtrue I did some research and found out that you should keep in mind that the sorting fields are first transformed to eg: not check it here https://play.golang.org/p/GvJV0E5Sj2_4 however, this raises a bug related to channels being pushed to the top of the |
@yswtrue did you solve your problem? |
I sort by message type now, so I haven't tried this solution. |
Closing this |
I need to put system_message channel and customer_message channel on the top of channelsPage, but I can't sort by a custom field like
priority
. Hope support for sorting by custom fields.gz#4687
The text was updated successfully, but these errors were encountered: