upgrade dependencies

This commit is contained in:
Salvatore Giordano
2021-05-12 16:54:44 +02:00
parent 9612bb1786
commit 6d1db8d4bf
10 changed files with 112 additions and 151 deletions
@@ -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,
),
),
+18 -22
View File
@@ -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:
+9 -9
View File
@@ -7,7 +7,7 @@ environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
flutter_app_badger: ^1.1.2
flutter_app_badger: ^1.2.0
flutter:
sdk: flutter
stream_chat_flutter:
@@ -20,13 +20,13 @@ dependencies:
url: https://github.com/GetStream/stream-chat-flutter.git
ref: develop
path: packages/stream_chat_persistence
flutter_local_notifications: ^2.0.2
flutter_svg: ^0.19.3
flutter_secure_storage: ^3.3.5
yaml: ^2.2.1
uuid: ^2.2.2
streaming_shared_preferences: ^1.0.2
lottie: ^0.7.0+1
flutter_local_notifications: ^5.0.0+4
flutter_svg: ^0.22.0
flutter_secure_storage: ^4.2.0
yaml: ^3.1.0
uuid: ^3.0.4
streaming_shared_preferences: ^2.0.0
lottie: ^1.0.1
dependency_overrides:
stream_chat:
@@ -41,7 +41,7 @@ dependency_overrides:
path: packages/stream_chat_flutter_core
dev_dependencies:
flutter_launcher_icons: ^0.8.1
flutter_launcher_icons: ^0.9.0
test: any
flutter:
@@ -1,30 +0,0 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:stream_chat_v1/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}