From 0e1ed9b66fc276f2df314bec86933ea7e828e818 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Wed, 23 Jun 2021 13:18:19 +0530 Subject: [PATCH] feat: Added new docs --- .../docs/Flutter/basics/introduction.mdx | 2 +- .../stream_chat_flutter_core/introduction.mdx | 8 ++++++++ .../stream_chat_core.mdx | 18 ++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docusaurus/docs/Flutter/basics/introduction.mdx b/docusaurus/docs/Flutter/basics/introduction.mdx index b3280a78..e39f82cc 100644 --- a/docusaurus/docs/Flutter/basics/introduction.mdx +++ b/docusaurus/docs/Flutter/basics/introduction.mdx @@ -59,7 +59,7 @@ Note: It is also possible to add more than two people in a distinct channel whic In summary, if you were creating a Whatsapp-like app, the first screen would be a list of channels - which on opening would show a list of messages that were sent by the users in the Channel. -While this is a simplistic overview of the service, thankfully the Flutter SDK handles the UI and more time consuming things (media upload, offline storage, theming, etc.) for us. +While this is a simplistic overview of the service, the Flutter SDK handles the UI and more time consuming things (media upload, offline storage, theming, etc.) for you. Before reading the docs, consider trying our [online API tour](https://getstream.io/chat/get_started/), it is a nice way to learn how the API works. diff --git a/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx b/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx index b9fc7c22..146bfa62 100644 --- a/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx +++ b/docusaurus/docs/Flutter/stream_chat_flutter_core/introduction.mdx @@ -63,6 +63,14 @@ Data fetching can be controlled with the controllers of the respective core comp Core Controllers are supplied to respective CoreList widgets which allows reloading and pagination of data whenever needed. +Unlike the UI package, the Core package allows a fully custom user interface built with the data. This +in turn provides a few challenges: we do not know implicitly when to paginate your list or reload your data. + +While this is handled out of the box in the UI package since the List implementation is inbuilt, a controller +needs to be used in the core package notifying the core components to reload or paginate the data existing +currently. For this, each core component has a respective controller which you can use to call the +specific function (reload / paginate) whenever such an event is triggered through / needed in your UI. + * ChannelListController * MessageListController * MessageSearchListController 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 d8ab6653..91d7cf65 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,7 +7,21 @@ title: StreamChatCore `StreamChatCore` is a version of `StreamChat` found in stream_chat_flutter that is decoupled from theme and initialisations. -Widget used to provide information about the chat to the widget tree. +`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 kept -alive for two minutes before being terminated. \ No newline at end of file +alive for two minutes before being terminated. + +Like the StreamChat widget in the higher level UI package, the StreamChatCore widget should +be on the top level before using any Stream functionality: + +```dart +return MaterialApp( + title: 'Stream Chat Core Example', + home: HomeScreen(), + builder: (context, child) => StreamChatCore( + client: client, + child: child!, + ), + ); +```