diff --git a/packages/dart_client/CHANGELOG.md b/packages/dart_client/CHANGELOG.md index fdaee098..c51f9a5f 100644 --- a/packages/dart_client/CHANGELOG.md +++ b/packages/dart_client/CHANGELOG.md @@ -1,3 +1,12 @@ +## 0.1.0-beta + +- 🛑 **BREAKING** Renamed `Client` to less generic `StreamChatClient` +- 🛑 **BREAKING** Segregated the persistence layer into separate package (stream_chat_persistence)[https://pub.dev/packages/stream_chat_persistence] +- 🛑 **BREAKING** Moved `Client.backgroundKeepAlive` to (core package)[https://pub.dev/packages/stream_chat_core] +- 🛑 **BREAKING** Moved `Client.showLocalNotification` to (core package)[https://pub.dev/packages/stream_chat_core] and renamed it to `StreamChatCore.onBackgroundEventReceived` +- Removed `flutter` dependency. This is now a pure Dart package 🥳 +- Minor improvements and bugfixes + ## 0.2.24+2 - Fix reconnection bug while using tokenProvider diff --git a/packages/dart_client/README.md b/packages/dart_client/README.md index 241c2f4e..4d3ca397 100644 --- a/packages/dart_client/README.md +++ b/packages/dart_client/README.md @@ -14,7 +14,7 @@ You can sign up for a Stream account at https://getstream.io/chat/ ```yaml dependencies: - stream_chat: ^0.2.0 + stream_chat: ^1.0.0-beta ``` You should then run `flutter packages get` @@ -57,27 +57,34 @@ final client = Client("stream-chat-api-key", logHandlerFunction: myLogHandlerFun ### 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 { +... +} -## Flutter Web - -Due to Moor web (for offline storage) you need to include the sql.js library: - -```html - - - - - - - - - +final client = Client( + apiKey ?? kDefaultStreamApiKey, + logLevel: Level.INFO, +)..chatPersistenceClient = CustomChatPersistentClient(); ``` -You can grab the latest version of sql-wasm.js and sql-wasm.wasm [here](https://github.com/sql-js/sql.js/releases) and copy them into your `/web` folder. +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 = Client( + apiKey ?? kDefaultStreamApiKey, + logLevel: Level.INFO, +)..chatPersistenceClient = chatPersistentClient; +``` ## Contributing diff --git a/packages/stream_chat_persistence/README.md b/packages/stream_chat_persistence/README.md index 6d9c21cf..d53d51e4 100644 --- a/packages/stream_chat_persistence/README.md +++ b/packages/stream_chat_persistence/README.md @@ -44,6 +44,24 @@ final chatPersistentClient = StreamChatPersistenceClient( And you are ready to go... +## Flutter Web + +Due to Moor web (for offline storage) you need to include the sql.js library: + +```html + + + + + + + + + +``` + +You can grab the latest version of sql-wasm.js and sql-wasm.wasm [here](https://github.com/sql-js/sql.js/releases) and copy them into your `/web` folder. + ## Contributing We welcome code changes that improve this library or fix a problem,