upgrade dependencies
This commit is contained in:
@@ -34,16 +34,14 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
||||
super.initState();
|
||||
final messageSearchBloc = MessageSearchBloc.of(context);
|
||||
messageSearchBloc.search(
|
||||
filter: {
|
||||
'cid': {
|
||||
r'$in': [StreamChannel.of(context).channel.cid]
|
||||
}
|
||||
},
|
||||
messageFilter: {
|
||||
'attachments.type': {
|
||||
r'$in': ['file'],
|
||||
},
|
||||
},
|
||||
filter: Filter.in_(
|
||||
'cid',
|
||||
[StreamChannel.of(context).channel.cid],
|
||||
),
|
||||
messageFilter: Filter.in_(
|
||||
'attachments.type',
|
||||
['file'],
|
||||
),
|
||||
sort: widget.sortOptions,
|
||||
pagination: widget.paginationParams,
|
||||
);
|
||||
@@ -142,16 +140,14 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
||||
|
||||
return LazyLoadScrollView(
|
||||
onEndOfPage: () => messageSearchBloc.search(
|
||||
filter: {
|
||||
'cid': {
|
||||
r'$in': [StreamChannel.of(context).channel.cid]
|
||||
}
|
||||
},
|
||||
messageFilter: {
|
||||
'attachments.type': {
|
||||
r'$in': ['file']
|
||||
},
|
||||
},
|
||||
filter: Filter.in_(
|
||||
'cid',
|
||||
[StreamChannel.of(context).channel.cid],
|
||||
),
|
||||
messageFilter: Filter.in_(
|
||||
'attachments.type',
|
||||
['file'],
|
||||
),
|
||||
sort: widget.sortOptions,
|
||||
pagination: widget.paginationParams.copyWith(
|
||||
offset: messageSearchBloc.messageResponses?.length ?? 0,
|
||||
|
||||
@@ -20,7 +20,10 @@ class ChannelMediaDisplayScreen extends StatefulWidget {
|
||||
|
||||
final ShowMessageCallback onShowMessage;
|
||||
|
||||
final MessageTheme messageTheme;
|
||||
|
||||
const ChannelMediaDisplayScreen({
|
||||
@required this.messageTheme,
|
||||
this.sortOptions,
|
||||
this.paginationParams,
|
||||
this.emptyBuilder,
|
||||
@@ -40,16 +43,14 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
super.initState();
|
||||
final messageSearchBloc = MessageSearchBloc.of(context);
|
||||
messageSearchBloc.search(
|
||||
filter: {
|
||||
'cid': {
|
||||
r'$in': [StreamChannel.of(context).channel.cid],
|
||||
}
|
||||
},
|
||||
messageFilter: {
|
||||
'attachments.type': {
|
||||
r'$in': ['image', 'video']
|
||||
},
|
||||
},
|
||||
filter: Filter.in_(
|
||||
'cid',
|
||||
[StreamChannel.of(context).channel.cid],
|
||||
),
|
||||
messageFilter: Filter.in_(
|
||||
'attachments.type',
|
||||
['image', 'video'],
|
||||
),
|
||||
sort: widget.sortOptions,
|
||||
pagination: widget.paginationParams,
|
||||
);
|
||||
@@ -165,16 +166,14 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
|
||||
return LazyLoadScrollView(
|
||||
onEndOfPage: () => messageSearchBloc.search(
|
||||
filter: {
|
||||
'cid': {
|
||||
r'$in': [StreamChannel.of(context).channel.cid]
|
||||
}
|
||||
},
|
||||
messageFilter: {
|
||||
'attachments.type': {
|
||||
r'$in': ['image', 'video']
|
||||
},
|
||||
},
|
||||
filter: Filter.in_(
|
||||
'cid',
|
||||
[StreamChannel.of(context).channel.cid],
|
||||
),
|
||||
messageFilter: Filter.in_(
|
||||
'attachments.type',
|
||||
['image', 'video'],
|
||||
),
|
||||
sort: widget.sortOptions,
|
||||
pagination: widget.paginationParams.copyWith(
|
||||
offset: messageSearchBloc.messageResponses?.length ?? 0,
|
||||
@@ -199,7 +198,6 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
media.map((e) => e.attachment).toList(),
|
||||
startIndex: position,
|
||||
message: media[position].message,
|
||||
sentAt: media[position].message.createdAt,
|
||||
userName: media[position].message.user.name,
|
||||
onShowMessage: widget.onShowMessage,
|
||||
),
|
||||
@@ -217,6 +215,7 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
MediaQuery.of(context).size.width * 0.8,
|
||||
MediaQuery.of(context).size.height * 0.3,
|
||||
),
|
||||
messageTheme: widget.messageTheme,
|
||||
),
|
||||
)
|
||||
: VideoPlayer(media[position].videoPlayer),
|
||||
|
||||
@@ -13,7 +13,13 @@ class ChatInfoScreen extends StatefulWidget {
|
||||
/// User in consideration
|
||||
final User user;
|
||||
|
||||
const ChatInfoScreen({Key key, this.user}) : super(key: key);
|
||||
final MessageTheme messageTheme;
|
||||
|
||||
const ChatInfoScreen({
|
||||
Key key,
|
||||
@required this.messageTheme,
|
||||
this.user,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ChatInfoScreenState createState() => _ChatInfoScreenState();
|
||||
@@ -217,6 +223,7 @@ class _ChatInfoScreenState extends State<ChatInfoScreen> {
|
||||
channel: channel,
|
||||
child: MessageSearchBloc(
|
||||
child: ChannelMediaDisplayScreen(
|
||||
messageTheme: widget.messageTheme,
|
||||
sortOptions: [
|
||||
SortOption(
|
||||
'created_at',
|
||||
@@ -445,20 +452,10 @@ class __SharedGroupsScreenState extends State<_SharedGroupsScreen> {
|
||||
),
|
||||
body: StreamBuilder<List<Channel>>(
|
||||
stream: chat.client.queryChannels(
|
||||
filter: {
|
||||
r'$and': [
|
||||
{
|
||||
'members': {
|
||||
r'$in': [widget.otherUser.id],
|
||||
},
|
||||
},
|
||||
{
|
||||
'members': {
|
||||
r'$in': [widget.mainUser.id],
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
filter: Filter.and([
|
||||
Filter.in_('members', [widget.otherUser.id]),
|
||||
Filter.in_('members', [widget.mainUser.id]),
|
||||
]),
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
|
||||
@@ -14,6 +14,13 @@ import 'main.dart';
|
||||
import 'routes/routes.dart';
|
||||
|
||||
class GroupInfoScreen extends StatefulWidget {
|
||||
final MessageTheme messageTheme;
|
||||
|
||||
const GroupInfoScreen({
|
||||
Key key,
|
||||
@required this.messageTheme,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_GroupInfoScreenState createState() => _GroupInfoScreenState();
|
||||
}
|
||||
@@ -502,6 +509,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
channel: channel,
|
||||
child: MessageSearchBloc(
|
||||
child: ChannelMediaDisplayScreen(
|
||||
messageTheme: widget.messageTheme,
|
||||
sortOptions: [
|
||||
SortOption(
|
||||
'created_at',
|
||||
@@ -657,18 +665,16 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
pagination: PaginationParams(
|
||||
limit: 25,
|
||||
),
|
||||
filter: {
|
||||
if (_searchController.text.isNotEmpty)
|
||||
'name': {
|
||||
r'$autocomplete': _userNameQuery,
|
||||
},
|
||||
'id': {
|
||||
r'$nin': [
|
||||
filter: Filter.and(
|
||||
[
|
||||
if (_searchController.text.isNotEmpty)
|
||||
Filter.autoComplete('name', _userNameQuery),
|
||||
Filter.notIn('id', [
|
||||
StreamChat.of(context).user.id,
|
||||
...channel.state.members.map((e) => e.userId),
|
||||
],
|
||||
},
|
||||
},
|
||||
]),
|
||||
],
|
||||
),
|
||||
sort: [
|
||||
SortOption(
|
||||
'name',
|
||||
@@ -848,6 +854,7 @@ class _GroupInfoScreenState extends State<GroupInfoScreen> {
|
||||
builder: (context) => StreamChannel(
|
||||
channel: c,
|
||||
child: ChatInfoScreen(
|
||||
messageTheme: widget.messageTheme,
|
||||
user: user,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -498,16 +498,12 @@ class UserMentionPage extends StatelessWidget {
|
||||
final user = StreamChat.of(context).user;
|
||||
return MessageSearchBloc(
|
||||
child: MessageSearchListView(
|
||||
filters: {
|
||||
'members': {
|
||||
r'$in': [user.id],
|
||||
},
|
||||
},
|
||||
messageFilters: {
|
||||
'mentioned_users.id': {
|
||||
r'$contains': user.id,
|
||||
},
|
||||
},
|
||||
filters: Filter.in_('members', [user.id]),
|
||||
messageFilters: Filter.custom(
|
||||
operator: 'contains',
|
||||
key: 'mentioned_users.id',
|
||||
value: user.id,
|
||||
),
|
||||
sortOptions: [
|
||||
SortOption(
|
||||
'created_at',
|
||||
@@ -651,11 +647,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
? MessageSearchListView(
|
||||
showErrorTile: true,
|
||||
messageQuery: _channelQuery,
|
||||
filters: {
|
||||
'members': {
|
||||
r'$in': [user.id]
|
||||
},
|
||||
},
|
||||
filters: Filter.in_('members', [user.id]),
|
||||
sortOptions: [
|
||||
SortOption(
|
||||
'created_at',
|
||||
@@ -720,11 +712,7 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
Navigator.pushNamed(context, Routes.NEW_CHAT);
|
||||
},
|
||||
swipeToAction: true,
|
||||
filter: {
|
||||
'members': {
|
||||
r'$in': [user.id],
|
||||
},
|
||||
},
|
||||
filter: Filter.in_('members', [user.id]),
|
||||
options: {
|
||||
'presence': true,
|
||||
},
|
||||
@@ -741,6 +729,8 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: ChatInfoScreen(
|
||||
messageTheme: StreamChatTheme.of(context)
|
||||
.ownMessageTheme,
|
||||
user: channel.state.members
|
||||
.where((m) =>
|
||||
m.userId !=
|
||||
@@ -757,7 +747,10 @@ class _ChannelListPageState extends State<ChannelListPage> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
channel: channel,
|
||||
child: GroupInfoScreen(),
|
||||
child: GroupInfoScreen(
|
||||
messageTheme: StreamChatTheme.of(context)
|
||||
.ownMessageTheme,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -843,6 +836,7 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
child: ChatInfoScreen(
|
||||
messageTheme: StreamChatTheme.of(context).ownMessageTheme,
|
||||
user: otherUser.user,
|
||||
),
|
||||
channel: channel,
|
||||
@@ -859,7 +853,9 @@ class _ChannelPageState extends State<ChannelPage> {
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => StreamChannel(
|
||||
child: GroupInfoScreen(),
|
||||
child: GroupInfoScreen(
|
||||
messageTheme: StreamChatTheme.of(context).ownMessageTheme,
|
||||
),
|
||||
channel: channel,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -70,13 +70,13 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
'state': false,
|
||||
'watch': false,
|
||||
},
|
||||
filter: {
|
||||
'members': [
|
||||
filter: Filter.and([
|
||||
Filter.equal('members', [
|
||||
..._selectedUsers.map((e) => e.id),
|
||||
chatState.user.id,
|
||||
],
|
||||
'distinct': true,
|
||||
},
|
||||
]),
|
||||
Filter.equal('distinct', true),
|
||||
]),
|
||||
messageLimit: 0,
|
||||
paginationParams: PaginationParams(
|
||||
limit: 1,
|
||||
@@ -308,15 +308,12 @@ class _NewChatScreenState extends State<NewChatScreen> {
|
||||
pagination: PaginationParams(
|
||||
limit: 25,
|
||||
),
|
||||
filter: {
|
||||
filter: Filter.and([
|
||||
if (_userNameQuery.isNotEmpty)
|
||||
'name': {
|
||||
r'$autocomplete': _userNameQuery,
|
||||
},
|
||||
'id': {
|
||||
r'$ne': StreamChat.of(context).user.id,
|
||||
},
|
||||
},
|
||||
Filter.autoComplete('name', _userNameQuery),
|
||||
Filter.notEqual(
|
||||
'id', StreamChat.of(context).user.id),
|
||||
]),
|
||||
sort: [
|
||||
SortOption(
|
||||
'name',
|
||||
|
||||
@@ -244,15 +244,11 @@ class _NewGroupChatScreenState extends State<NewGroupChatScreen> {
|
||||
pagination: PaginationParams(
|
||||
limit: 25,
|
||||
),
|
||||
filter: {
|
||||
filter: Filter.and([
|
||||
if (_userNameQuery.isNotEmpty)
|
||||
'name': {
|
||||
r'$autocomplete': _userNameQuery,
|
||||
},
|
||||
'id': {
|
||||
r'$ne': StreamChat.of(context).user.id,
|
||||
}
|
||||
},
|
||||
Filter.autoComplete('name', _userNameQuery),
|
||||
Filter.notEqual('id', StreamChat.of(context).user.id),
|
||||
]),
|
||||
sort: [
|
||||
SortOption(
|
||||
'name',
|
||||
|
||||
@@ -74,16 +74,19 @@ class AppRoutes {
|
||||
case Routes.CHAT_INFO_SCREEN:
|
||||
return MaterialPageRoute(
|
||||
settings: const RouteSettings(name: Routes.CHAT_INFO_SCREEN),
|
||||
builder: (_) {
|
||||
builder: (context) {
|
||||
return ChatInfoScreen(
|
||||
user: args,
|
||||
messageTheme: StreamChatTheme.of(context).ownMessageTheme,
|
||||
);
|
||||
});
|
||||
case Routes.GROUP_INFO_SCREEN:
|
||||
return MaterialPageRoute(
|
||||
settings: const RouteSettings(name: Routes.GROUP_INFO_SCREEN),
|
||||
builder: (_) {
|
||||
return GroupInfoScreen();
|
||||
builder: (context) {
|
||||
return GroupInfoScreen(
|
||||
messageTheme: StreamChatTheme.of(context).ownMessageTheme,
|
||||
);
|
||||
});
|
||||
// Default case, should not reach here.
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user