From fe45b2ef6e21b8a36934591abf314522137c238b Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 1 Feb 2021 19:11:57 +0530 Subject: [PATCH] Update README.md Signed-off-by: Sahil Kumar --- packages/flutter_widgets/README.md | 2 +- packages/stream_chat_flutter_core/README.md | 2 +- packages/stream_chat_persistence/README.md | 59 +++++++++++++++++---- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/packages/flutter_widgets/README.md b/packages/flutter_widgets/README.md index 8104e83a..b99a8f29 100644 --- a/packages/flutter_widgets/README.md +++ b/packages/flutter_widgets/README.md @@ -1,7 +1,7 @@ # Official Flutter SDK for [Stream Chat](https://getstream.io/chat/)

- Flutter Chat + Flutter Chat

> The official Flutter components for Stream Chat, a service for diff --git a/packages/stream_chat_flutter_core/README.md b/packages/stream_chat_flutter_core/README.md index a62da863..6fe86329 100644 --- a/packages/stream_chat_flutter_core/README.md +++ b/packages/stream_chat_flutter_core/README.md @@ -1,7 +1,7 @@ # Official Flutter SDK Core for [Stream Chat](https://getstream.io/chat/)

- Flutter Chat + Flutter Chat

> The official Flutter core components for Stream Chat, a service for diff --git a/packages/stream_chat_persistence/README.md b/packages/stream_chat_persistence/README.md index 3e3f0c7c..6d9c21cf 100644 --- a/packages/stream_chat_persistence/README.md +++ b/packages/stream_chat_persistence/README.md @@ -1,14 +1,53 @@ -# stream_chat_persistence +# Official Chat Persistence Client for [Stream Chat](https://getstream.io/chat/) -A new Flutter package. +

+ Flutter Chat +

-## Getting Started +> The official Chat Persistence Client for Stream Chat, a service for +> building chat applications. -This project is a starting point for a Dart -[package](https://flutter.dev/developing-packages/), -a library module containing code that can be shared easily across -multiple Flutter or Dart projects. +[![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) + -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +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. + +## Add dependency +Add this to your package's pubspec.yaml file, use the latest version [![Pub](https://img.shields.io/pub/v/stream_chat_persistence.svg)](https://pub.dartlang.org/packages/stream_chat_persistence) +```yaml +dependencies: + stream_chat_persistence: ^latest_version +``` + +You should then run `flutter packages get` + +## Usage +The usage is pretty simple. +1. Create a new instance of StreamChatPersistenceClient providing `logLevel` and `connectionMode`. +```dart +final chatPersistentClient = StreamChatPersistenceClient( + logLevel: Level.INFO, + connectionMode: ConnectionMode.background, +); +``` +2. Pass the instance to the official Stream chat client. +```dart + final client = Client( + apiKey ?? kDefaultStreamApiKey, + logLevel: Level.INFO, + )..chatPersistenceClient = chatPersistentClient; +``` + +And you are ready to go... + +## Contributing + +We welcome code changes that improve this library or fix a problem, +please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. +We are pleased to merge your code into the official repository. +Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. +See our license file for more details.