From d8d795d03fc26b3094430d0b74a4ee9aa687d8ce Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 4 Feb 2021 10:59:37 +0100 Subject: [PATCH] update readmes --- README.md | 66 +++++++++------------ packages/stream_chat/README.md | 20 ++++--- packages/stream_chat_flutter/README.md | 35 +++++++++-- packages/stream_chat_flutter_core/README.md | 9 +-- packages/stream_chat_persistence/README.md | 14 +++-- 5 files changed, 82 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 816e96a1..01e5da89 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,16 @@ -# Stream Chat Dart +# Official Flutter packages for [Stream Chat](https://getstream.io/chat/) ![](https://camo.githubusercontent.com/f5f074f3e1cde523ae0d425347149e20f861024d1d8e19b22053294ad85c43c8/68747470733a2f2f692e696d6775722e636f6d2f4c344d6a3853322e706e67) +[![Gitter](https://badges.gitter.im/GetStream/stream-chat-flutter.svg)](https://gitter.im/GetStream/stream-chat-flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +![CI](https://github.com/GetStream/stream-chat-flutter/workflows/stream_flutter_workflow/badge.svg?branch=master) + +**Quick Links** + +- [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat +- [Flutter Chat Tutorial](https://getstream.io/chat/flutter/tutorial/) +- [Chat UI Kit](https://getstream.io/chat/ui-kit/) + This repository contains code for our [Dart](https://dart.dev/) and [Flutter](https://flutter.dev/) chat clients. Stream allows developers to rapidly deploy scalable feeds and chat messaging with an industry leading 99.999% uptime SLA guarantee. @@ -15,45 +24,28 @@ To get started, run `bootstrap` after cloning the project. melos bootstrap ``` -## Available Commands -### Analyze -> Requires `tuneup` to be activated globally. Please see https://pub.dev/packages/tuneup -```shell -melos run analyze -``` +## Packages +We provide a variety of packages depending on the level of customization you want to achieve. -### Pub Lint -Runs pub publish with ``--dry-run`` -```shell -melos run lint:pub -``` +### [stream_chat](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat) +A pure Dart package that can be used on any Dart project. It provides a low-level client to access the Stream Chat service. -### Build iOS -Builds iOS examples without codesign -```shell -melos run build:examples:ios -``` +### [stream_chat_persistence](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_persistence) +This package provides a persistence client for fetching and saving chat data locally. Stream Chat Persistence uses Moor as a disk cache. -### Build APK -Builds an Android APK for examples -```shell -melos run build:examples:android -``` +### [stream_chat_flutter_core](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_flutter_core) +This package provides business logic to fetch common things required for integrating Stream Chat into your application. The core package allows more customisation and hence provides business logic but no UI components. -### Build MACOS -Builds MacOs for all examples -```shell -melos run build:examples:macos -``` +### [stream_chat_flutter](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_flutter) +This library includes both a low-level chat SDK and a set of reusable and customizable UI components. -### Test -Runs `flutter test` on all packages -```shell -melos run test -``` +## Flutter Chat Tutorial -### Test Web -Runs `flutter test --platform=chrome` on all packages -```shell -melos run test:web -``` +The best place to start is the [Flutter Chat Tutorial](https://getstream.io/chat/flutter/tutorial/). +It teaches you how to use this SDK and also shows how to make frequently required changes. + +## Example Apps + +Every package folder includes a fully functional example with setup instructions. + +We also provide a set of sample apps created using the Stream Flutter SDK at this location. https://github.com/GetStream/flutter-samples \ No newline at end of file diff --git a/packages/stream_chat/README.md b/packages/stream_chat/README.md index e0ed18bf..224878e3 100644 --- a/packages/stream_chat/README.md +++ b/packages/stream_chat/README.md @@ -1,20 +1,26 @@ -# Stream Chat Dart +# Official Dart Client for [Stream Chat](https://getstream.io/chat/) + +>The official Dart client for Stream Chat, a service for building chat applications. This library can be used on any Dart project and on both mobile and web apps with Flutter. + [![Pub](https://img.shields.io/pub/v/stream_chat.svg)](https://pub.dartlang.org/packages/stream_chat) ![](https://img.shields.io/badge/platform-flutter%20%7C%20flutter%20web-ff69b4.svg?style=flat-square) -![CI](https://github.com/GetStream/stream-chat-dart/workflows/CI/badge.svg?branch=master) -[![codecov](https://codecov.io/gh/GetStream/stream-chat-dart/branch/master/graph/badge.svg)](https://codecov.io/gh/GetStream/stream-chat-dart) +[![Gitter](https://badges.gitter.im/GetStream/stream-chat-flutter.svg)](https://gitter.im/GetStream/stream-chat-flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +![CI](https://github.com/GetStream/stream-chat-flutter/workflows/stream_flutter_workflow/badge.svg?branch=master) -stream-chat-dart is the official Dart client for Stream Chat, a service for building chat applications. This library can be used on any Dart project and on both mobile and web apps with Flutter. +**Quick Links** -You can sign up for a Stream account at https://getstream.io/chat/ +- [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat +- [Flutter Chat Tutorial](https://getstream.io/chat/flutter/tutorial/) +- [Chat UI Kit](https://getstream.io/chat/ui-kit/) ## Getting started ### Add dependency +Add this to your package's pubspec.yaml file, use the latest version [![Pub](https://img.shields.io/pub/v/stream_chat.svg)](https://pub.dartlang.org/packages/stream_chat) ```yaml dependencies: - stream_chat: ^1.0.0-beta + stream_chat: ^latest-version ``` You should then run `flutter packages get` @@ -70,7 +76,7 @@ final client = StreamChatClient( )..chatPersistenceClient = CustomChatPersistentClient(); ``` -We provide an official persistent client in the (stream_chat_persistence)[https://pub.dev/packages/stream_chat_persistence] package. +We provide an official persistent client in the [stream_chat_persistence](https://pub.dev/packages/stream_chat_persistence) package. ```dart import 'package:stream_chat_persistence/stream_chat_persistence.dart'; diff --git a/packages/stream_chat_flutter/README.md b/packages/stream_chat_flutter/README.md index 3504c78a..70e2250f 100644 --- a/packages/stream_chat_flutter/README.md +++ b/packages/stream_chat_flutter/README.md @@ -10,7 +10,7 @@ [![Pub](https://img.shields.io/pub/v/stream_chat_flutter.svg)](https://pub.dartlang.org/packages/stream_chat_flutter) ![](https://img.shields.io/badge/platform-flutter%20%7C%20flutter%20web-ff69b4.svg?style=flat-square) [![Gitter](https://badges.gitter.im/GetStream/stream-chat-flutter.svg)](https://gitter.im/GetStream/stream-chat-flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -![CI](https://github.com/GetStream/stream-chat-flutter/workflows/CI/badge.svg?branch=master) +![CI](https://github.com/GetStream/stream-chat-flutter/workflows/stream_flutter_workflow/badge.svg?branch=master) **Quick Links** @@ -61,8 +61,8 @@ If it seems related to the [flutter file picker plugin](https://github.com/migue ## Docs This package provides UI components required for integrating Stream Chat into your application. -Alternatively, you may use the core package (stream_chat_flutter_core) which allows more customisation and provides business logic but no UI components. -If you require the maximum amount of control over the API, please use the low level client package: stream_chat. +Alternatively, you may use the core package [stream_chat_flutter_core](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_flutter_core) which allows more customisation and provides business logic but no UI components. +If you require the maximum amount of control over the API, please use the low level client package: [stream_chat](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat). ### UI Components @@ -152,9 +152,34 @@ Out of the box, all chat widgets use their default styling, and there are two wa ### Offline storage -By default the library saves information about channels and messages in a SQLite DB. +To add data persistance you can extend the class `ChatPersistenceClient` and pass an instance to the `StreamChatClient`. -Set the property `persistenceEnabled` to false if you don't want to use the offline storage. +```dart +class CustomChatPersistentClient extends ChatPersistenceClient { +... +} + +final client = StreamChatClient( + apiKey ?? kDefaultStreamApiKey, + logLevel: Level.INFO, +)..chatPersistenceClient = CustomChatPersistentClient(); +``` + +We provide an official persistent client in the (stream_chat_persistence)[https://pub.dev/packages/stream_chat_persistence] package. + +```dart +import 'package:stream_chat_persistence/stream_chat_persistence.dart'; + +final chatPersistentClient = StreamChatPersistenceClient( + logLevel: Level.INFO, + connectionMode: ConnectionMode.background, +); + +final client = StreamChatClient( + apiKey ?? kDefaultStreamApiKey, + logLevel: Level.INFO, +)..chatPersistenceClient = chatPersistentClient; +``` ## Contributing diff --git a/packages/stream_chat_flutter_core/README.md b/packages/stream_chat_flutter_core/README.md index 6fe86329..c2bfed2c 100644 --- a/packages/stream_chat_flutter_core/README.md +++ b/packages/stream_chat_flutter_core/README.md @@ -1,8 +1,4 @@ -# Official Flutter SDK Core for [Stream Chat](https://getstream.io/chat/) - -

- Flutter Chat -

+# Official Core Flutter SDK for [Stream Chat](https://getstream.io/chat/) > The official Flutter core components for Stream Chat, a service for > building chat applications. @@ -10,8 +6,7 @@ [![Pub](https://img.shields.io/pub/v/stream_chat_flutter.svg)](https://pub.dartlang.org/packages/stream_chat_flutter) ![](https://img.shields.io/badge/platform-flutter%20%7C%20flutter%20web-ff69b4.svg?style=flat-square) [![Gitter](https://badges.gitter.im/GetStream/stream-chat-flutter.svg)](https://gitter.im/GetStream/stream-chat-flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -![CI](https://github.com/GetStream/stream-chat-flutter/workflows/CI/badge.svg?branch=master) - +![CI](https://github.com/GetStream/stream-chat-flutter/workflows/stream_flutter_workflow/badge.svg?branch=master) **Quick Links** diff --git a/packages/stream_chat_persistence/README.md b/packages/stream_chat_persistence/README.md index 77b2eea5..c6ce62de 100644 --- a/packages/stream_chat_persistence/README.md +++ b/packages/stream_chat_persistence/README.md @@ -1,17 +1,19 @@ # Official Chat Persistence Client for [Stream Chat](https://getstream.io/chat/) -

- Flutter Chat -

- > The official Chat Persistence Client for Stream Chat, a service for > building chat applications. [![Pub](https://img.shields.io/pub/v/stream_chat_persistence.svg)](https://pub.dartlang.org/packages/stream_chat_persistence) ![](https://img.shields.io/badge/platform-flutter%20%7C%20flutter%20web-ff69b4.svg?style=flat-square) [![Gitter](https://badges.gitter.im/GetStream/stream_chat_persistence.svg)](https://gitter.im/GetStream/stream-chat-flutter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -![CI](https://github.com/GetStream/stream-chat-flutter/workflows/CI/badge.svg?branch=master) - +![CI](https://github.com/GetStream/stream-chat-flutter/workflows/stream_flutter_workflow/badge.svg?branch=master) + + +**Quick Links** + +- [Register](https://getstream.io/chat/trial/) to get an API key for Stream Chat +- [Flutter Chat Tutorial](https://getstream.io/chat/flutter/tutorial/) +- [Chat UI Kit](https://getstream.io/chat/ui-kit/) This package provides a persistence client for fetching and saving chat data locally. Stream Chat Persistence uses [Moor](https://github.com/simolus3/moor) as a disk cache.