From 0ec80452b6a4fedfbb61b3477b85b5bfe4d06a62 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 2 May 2022 12:15:32 +0200 Subject: [PATCH] LazyLoadScrollView --- .../stream_chat_flutter_core/introduction.mdx | 1 - .../lazy_load_scroll_view.mdx | 41 +++++++++++++++++++ .../message_list_core.mdx | 2 + .../stream_channel_list_controller.mdx | 2 + .../stream_chat_core.mdx | 2 + .../stream_message_input_controller.mdx | 2 + .../stream_message_search_list_controller.mdx | 2 + .../stream_user_list_controller.mdx | 2 + 8 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 docusaurus/docs/Flutter/stream_chat_flutter_core/lazy_load_scroll_view.mdx diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx index fd53daee..5cb8f0db 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx @@ -31,7 +31,6 @@ Controllers are used to handle the business logic of the chat. You can use them * StreamUserListController * StreamMessageSearchListController * StreamMessageInputController -* MessageListController * LazyLoadScrollView * PagedValueListenableBuilder diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/lazy_load_scroll_view.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/lazy_load_scroll_view.mdx new file mode 100644 index 00000000..457f15c7 --- /dev/null +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/lazy_load_scroll_view.mdx @@ -0,0 +1,41 @@ +--- +id: lazy_load_scroll_view +sidebar_position: 8 +title: LazyLoadScrollView +--- + +A Widget For Building A Paginated List + +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/LazyLoadScrollView-class.html) + +### Background + +The `LazyLoadScrollView` is a widget that helps you build a paginated list. +It provides callbacks to notify you when the list has been scrolled to the bottom and when the list has been scrolled to the top and other necessary callbacks. + +#### Callbacks + +* onStartOfPage: called when the list has been scrolled to the top of the page. + +* onEndOfPage: called when the list has been scrolled to the bottom of the page. + +* onPageScrollStart: called when the scroll of the list starts. + +* onPageScrollEnd: called when the scroll of the list ends. + +* onInBetweenOfPage: called when the list is not either at the top nor at the bottom of the page. + +### Basic Example + +Building a paginated list is a very common task. Here is an example of how to use the `LazyLoadScrollView` to build a simple list with pagination. + +```dart +LazyLoadScrollView( + onEndOfPage: _paginateData, + /// The child could be any widget which dispatches [ScrollNotification]s. + /// For example [ListView], [GridView] or [CustomScrollView]. + child: ListView.builder( + itemBuilder: ((context, index) => _buildListTile), + ), +) +``` diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/message_list_core.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/message_list_core.mdx index 5fd5877a..57f06b2a 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/message_list_core.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/message_list_core.mdx @@ -6,6 +6,8 @@ title: MessageListCore A Widget For Building A List Of Messages +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/MessageListCore-class.html) + ### Background The UI SDK of Stream Chat supplies a `MessageListView` class that builds a list of channels fetching diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_channel_list_controller.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_channel_list_controller.mdx index 310ee569..ac478f99 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_channel_list_controller.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_channel_list_controller.mdx @@ -6,6 +6,8 @@ title: StreamChannelListController A Widget For Controlling A List Of Channels +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/StreamChannelListController-class.html) + ### Background The `StreamChannelListController` is a controller class that allows you to control a list of channels. diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_chat_core.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_chat_core.mdx index 2a43ae52..e3434e7f 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_chat_core.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_chat_core.mdx @@ -7,6 +7,8 @@ title: StreamChatCore `StreamChatCore` is a version of `StreamChat` found in `stream_chat_flutter` that is decoupled from theme and initialisations. +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/StreamChatCore-class.html) + `StreamChatCore` is used to provide information about the chat client to the widget tree. This Widget is used to react to life cycle changes and system updates. When the app goes into the background, the websocket connection is automatically closed and when it goes back to foreground the connection is opened again. diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_input_controller.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_input_controller.mdx index 4da94fbe..7139d15e 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_input_controller.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_input_controller.mdx @@ -6,6 +6,8 @@ title: StreamMessageInputController A Widget For Controlling A Message Input +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/StreamMessageInputController-class.html) + ### Background The `StreamMessageInputController` is a controller class that embed the business logic to compose a message. diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_search_list_controller.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_search_list_controller.mdx index c854808b..f4546331 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_search_list_controller.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_message_search_list_controller.mdx @@ -6,6 +6,8 @@ title: StreamMessageSearchListController A Widget For Controlling A List Of Searched Messages +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/StreamMessageSearchListController-class.html) + ### Background The `StreamMessageSearchListController` is a controller class that allows you to control a list of searched messages. diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_user_list_controller.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_user_list_controller.mdx index 6a035540..0bee29ed 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_user_list_controller.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/stream_user_list_controller.mdx @@ -6,6 +6,8 @@ title: StreamUserListController A Widget For Controlling A List Of Users +Find the pub.dev documentation [here](https://pub.dev/documentation/stream_chat_flutter_core/latest/stream_chat_flutter_core/StreamUserListController-class.html) + ### Background The `StreamUserListController` is a controller class that allows you to control a list of users.