add type safe filters in queryUsers and queryMembers

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-04-30 14:21:10 +05:30
parent 9c5aceeb91
commit a2d8ddc72b
7 changed files with 12 additions and 17 deletions
@@ -1243,11 +1243,10 @@ class MessageInputState extends State<MessageInput> {
Future<List<Member>> queryMembers;
if (query.isNotEmpty) {
queryMembers = StreamChannel.of(context).channel.queryMembers(filter: {
'name': {
'\$autocomplete': query,
},
}).then((res) => res.members);
queryMembers = StreamChannel.of(context)
.channel
.queryMembers(filter: Filter.autoComplete('name', query))
.then((res) => res.members);
}
final members = StreamChannel.of(context).channel.state.members?.where((m) {
@@ -72,7 +72,7 @@ class UserListView extends StatefulWidget {
/// The query filters to use.
/// You can query on any of the custom fields you've defined on the [Channel].
/// You can also filter other built-in channel fields.
final Map<String, dynamic> filter;
final Filter filter;
/// Query channels options.
///