bump deps

This commit is contained in:
Salvatore Giordano
2021-05-17 15:48:03 +02:00
parent 0e506c6df7
commit 273b24bcd8
2 changed files with 61 additions and 73 deletions
+56 -68
View File
@@ -1,18 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/date_symbol_data_local.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart' import 'package:stream_chat_flutter/stream_chat_flutter.dart'
show hide ChannelListView;
Channel,
ChannelListController,
ChannelListCore,
ChannelsBloc,
LazyLoadScrollView,
Level,
PaginationParams,
SortOption,
StreamChatClient,
StreamChatCore,
User;
import 'package:imessage/channel_list_view.dart'; import 'package:imessage/channel_list_view.dart';
@@ -61,61 +50,60 @@ class ChatLoader extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final user = StreamChatCore.of(context).user; final user = StreamChatCore.of(context).user;
return CupertinoPageScaffold( return CupertinoPageScaffold(
child: ChannelsBloc( child: ChannelsBloc(
child: ChannelListCore( child: ChannelListCore(
channelListController: channelListController, channelListController: channelListController,
filter: { filter: Filter.and([
'members': { Filter.in_('members', [user.id]),
r'$in': [user.id], Filter.equal('type', 'messaging'),
}, ]),
'type': { sort: [SortOption('last_message_at')],
r'$eq': 'messaging', pagination: PaginationParams(
}, limit: 20,
}, ),
sort: [SortOption('last_message_at')], emptyBuilder: (BuildContext context) {
pagination: PaginationParams( return Center(
limit: 20, child: Text('Looks like you are not in any channels'),
), );
emptyBuilder: (BuildContext context) { },
return Center( loadingBuilder: (BuildContext context) {
child: Text('Looks like you are not in any channels'), return Center(
); child: SizedBox(
}, height: 100.0,
loadingBuilder: (BuildContext context) { width: 100.0,
return Center( child: CupertinoActivityIndicator(),
child: SizedBox( ),
height: 100.0, );
width: 100.0, },
child: CupertinoActivityIndicator(), errorBuilder: (BuildContext context, dynamic error) {
), return Center(
); child: Text(
}, 'Oh no, something went wrong. Please check your config.'),
errorBuilder: (BuildContext context, dynamic error) { );
return Center( },
child: Text( listBuilder: (
'Oh no, something went wrong. Please check your config.'), BuildContext context,
); List<Channel> channels,
}, ) =>
listBuilder: ( LazyLoadScrollView(
BuildContext context, onEndOfPage: () async {
List<Channel> channels, return channelListController.paginateData();
) => },
LazyLoadScrollView( child: CustomScrollView(
onEndOfPage: () async { slivers: [
channelListController.paginateData(); CupertinoSliverRefreshControl(onRefresh: () async {
}, return channelListController.loadData();
child: CustomScrollView( }),
slivers: [ ChannelPageAppBar(),
CupertinoSliverRefreshControl(onRefresh: () async { SliverPadding(
channelListController.loadData(); sliver: ChannelListView(channels: channels),
}), padding: const EdgeInsets.only(top: 16),
ChannelPageAppBar(), )
SliverPadding( ],
sliver: ChannelListView(channels: channels), ),
padding: const EdgeInsets.only(top: 16), ),
) ),
], ),
), );
))));
} }
} }
+5 -5
View File
@@ -23,11 +23,11 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
intl: ^0.16.1 intl: ^0.17.0
stream_chat_flutter: ^1.3.0-beta stream_chat_flutter: ^2.0.0-nullsafety.3
animations: ^1.0.0+5 animations: ^2.0.0
collection: ^1.14.13 collection: ^1.15.0
cached_network_image: ^2.0.0-rc cached_network_image: ^3.0.0
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.