update example
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 46;
|
objectVersion = 50;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
97C146E61CF9000F007C117D /* Project object */ = {
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 1020;
|
LastUpgradeCheck = 1300;
|
||||||
ORGANIZATIONNAME = "";
|
ORGANIZATIONNAME = "";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
97C146ED1CF9000F007C117D = {
|
97C146ED1CF9000F007C117D = {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "1020"
|
LastUpgradeVersion = "1300"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|||||||
@@ -62,16 +62,26 @@ class ChannelListPage extends StatelessWidget {
|
|||||||
// ignore: prefer_expression_function_bodies
|
// ignore: prefer_expression_function_bodies
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: ChannelsBloc(
|
body: StreamChannelListView(
|
||||||
child: ChannelListView(
|
controller: StreamChannelListController(
|
||||||
|
client: StreamChat.of(context).client,
|
||||||
filter: Filter.in_(
|
filter: Filter.in_(
|
||||||
'members',
|
'members',
|
||||||
[StreamChat.of(context).currentUser!.id],
|
[StreamChat.of(context).currentUser!.id],
|
||||||
),
|
),
|
||||||
sort: const [SortOption('last_message_at')],
|
sort: const [SortOption('last_message_at')],
|
||||||
limit: 20,
|
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.
|
/// Returns `true` if the [PagedValue] is [Success] and has an error.
|
||||||
bool get hasError => asSuccess.error != null;
|
bool get hasError => asSuccess.error != null;
|
||||||
|
|
||||||
///
|
///
|
||||||
int get itemCount {
|
int get itemCount {
|
||||||
final count = asSuccess.items.length;
|
final count = asSuccess.items.length;
|
||||||
if (hasNextPage || hasError) return count + 1;
|
if (hasNextPage || hasError) return count + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user