update example

This commit is contained in:
Salvatore Giordano
2022-01-18 16:39:07 +01:00
parent 51e7c873cb
commit 96fae22655
4 changed files with 17 additions and 7 deletions
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
@@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -62,16 +62,26 @@ class ChannelListPage extends StatelessWidget {
// ignore: prefer_expression_function_bodies
Widget build(BuildContext context) {
return Scaffold(
body: ChannelsBloc(
child: ChannelListView(
body: StreamChannelListView(
controller: StreamChannelListController(
client: StreamChat.of(context).client,
filter: Filter.in_(
'members',
[StreamChat.of(context).currentUser!.id],
),
sort: const [SortOption('last_message_at')],
limit: 20,
channelWidget: const ChannelPage(),
),
onChannelTap: (channel) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => StreamChannel(
channel: channel,
child: const ChannelPage(),
),
),
);
},
),
);
}
@@ -123,7 +123,7 @@ abstract class PagedValue<Key, Value> with _$PagedValue<Key, Value> {
/// Returns `true` if the [PagedValue] is [Success] and has an error.
bool get hasError => asSuccess.error != null;
///
///
int get itemCount {
final count = asSuccess.items.length;
if (hasNextPage || hasError) return count + 1;