feat: Added mig guide (scfc)

This commit is contained in:
Deven Joshi
2021-07-16 19:12:30 +05:30
parent 5ae9933321
commit 9bf0aac3fa
@@ -19,43 +19,43 @@ The changes will be listed by package and a concise changelog will be followed b
### Changelog of `stream_chat_flutter` ### Changelog of `stream_chat_flutter`
#### Breaking Changes from 1.5.4 #### 🛑️ Breaking Changes from 1.5.4
*Migrate this package to null safety * Migrate this package to null safety
*Renamed ChannelImage to ChannelAvatar * Renamed ChannelImage to ChannelAvatar
*Updated StreamChatThemeData.reactionIcons to accept custom builder * Updated StreamChatThemeData.reactionIcons to accept custom builder
*Renamed ColorTheme properties to reflect the purpose of the colors * Renamed ColorTheme properties to reflect the purpose of the colors
*ColorTheme.black -> ColorTheme.textHighEmphasis * ColorTheme.black -> ColorTheme.textHighEmphasis
*ColorTheme.grey -> ColorTheme.textLowEmphasis * ColorTheme.grey -> ColorTheme.textLowEmphasis
*ColorTheme.greyGainsboro -> ColorTheme.disabled * ColorTheme.greyGainsboro -> ColorTheme.disabled
*ColorTheme.greyWhisper -> ColorTheme.borders * ColorTheme.greyWhisper -> ColorTheme.borders
*ColorTheme.whiteSmoke -> ColorTheme.inputBg * ColorTheme.whiteSmoke -> ColorTheme.inputBg
*ColorTheme.whiteSnow -> ColorTheme.appBg * ColorTheme.whiteSnow -> ColorTheme.appBg
*ColorTheme.white -> ColorTheme.barsBg * ColorTheme.white -> ColorTheme.barsBg
*ColorTheme.blueAlice -> ColorTheme.linkBg * ColorTheme.blueAlice -> ColorTheme.linkBg
*ColorTheme.accentBlue -> ColorTheme.accentPrimary * ColorTheme.accentBlue -> ColorTheme.accentPrimary
*ColorTheme.accentRed -> ColorTheme.accentError * ColorTheme.accentRed -> ColorTheme.accentError
*ColorTheme.accentGreen -> ColorTheme.accentInfo * ColorTheme.accentGreen -> ColorTheme.accentInfo
*ChannelListCore options property is removed in favor of individual properties * ChannelListCore options property is removed in favor of individual properties
*options.state -> bool state *options.state -> bool state
*options.watch -> bool watch *options.watch -> bool watch
*options.presence -> bool presence *options.presence -> bool presence
*UserListView options property is removed in favor of individual properties * UserListView options property is removed in favor of individual properties
*options.presence -> bool presence *options.presence -> bool presence
*Renamed ImageHeader to GalleryHeader * Renamed ImageHeader to GalleryHeader
*Renamed ImageFooter to GalleryFooter * Renamed ImageFooter to GalleryFooter
*MessageBuilder and ParentMessageBuilder signature is now * MessageBuilder and ParentMessageBuilder signature is now
``` ```
typedef MessageBuilder = Widget Function( typedef MessageBuilder = Widget Function(
@@ -117,17 +117,17 @@ remedy the issue:
2) The new version comes with revised color names since the previous names do not suit light/dark mode 2) The new version comes with revised color names since the previous names do not suit light/dark mode
nomenclature. Make sure any old colors used from theme are changed over to the new theme color names: nomenclature. Make sure any old colors used from theme are changed over to the new theme color names:
*ColorTheme.black -> ColorTheme.textHighEmphasis * ColorTheme.black -> ColorTheme.textHighEmphasis
*ColorTheme.grey -> ColorTheme.textLowEmphasis * ColorTheme.grey -> ColorTheme.textLowEmphasis
*ColorTheme.greyGainsboro -> ColorTheme.disabled * ColorTheme.greyGainsboro -> ColorTheme.disabled
*ColorTheme.greyWhisper -> ColorTheme.borders * ColorTheme.greyWhisper -> ColorTheme.borders
*ColorTheme.whiteSmoke -> ColorTheme.inputBg * ColorTheme.whiteSmoke -> ColorTheme.inputBg
*ColorTheme.whiteSnow -> ColorTheme.appBg * ColorTheme.whiteSnow -> ColorTheme.appBg
*ColorTheme.white -> ColorTheme.barsBg * ColorTheme.white -> ColorTheme.barsBg
*ColorTheme.blueAlice -> ColorTheme.linkBg * ColorTheme.blueAlice -> ColorTheme.linkBg
*ColorTheme.accentBlue -> ColorTheme.accentPrimary * ColorTheme.accentBlue -> ColorTheme.accentPrimary
*ColorTheme.accentRed -> ColorTheme.accentError * ColorTheme.accentRed -> ColorTheme.accentError
*ColorTheme.accentGreen -> ColorTheme.accentInfo * ColorTheme.accentGreen -> ColorTheme.accentInfo
3) We decided to make messages easier to customize and now supply the default implementation of the 3) We decided to make messages easier to customize and now supply the default implementation of the
messages in the builder - so you can now customize a single parameter without having to redo the messages in the builder - so you can now customize a single parameter without having to redo the
@@ -143,4 +143,97 @@ typedef MessageBuilder = Widget Function(
``` ```
Use `defaultMessageWidget.copyWith()` to edit any properties to make it much simpler to tweak the Use `defaultMessageWidget.copyWith()` to edit any properties to make it much simpler to tweak the
default implementation. default implementation.
### Changelog of `stream_chat_flutter_core`
#### 🛑️ Breaking Changes from 1.5.3
* Migrate this package to null safety
* channelsBloc.queryChannels(), ChannelListCore options param/property is removed in favor of individual params/properties
* options.state -> bool state
* options.watch -> bool watch
* options.presence -> bool presence
* usersBloc.queryUsers(), UserListCore options param/property is removed in favor of individual params/properties
* options.presence -> bool presence
#### ✅ Added
* Monitor connection using connectivity_plus package
#### 🐞 Fixed
* Minor fixes
* Performance improvements
### Migrating to 2.0 for `stream_chat_flutter_core`
If you are migrating your full Flutter project to null-safety, first make sure you follow the
instructions from the [official Null Safety migration guide](https://dart.dev/null-safety/migration-guide).
:::
To migrate to v2.0 for `stream_chat_flutter_core`, first change the version of the package to the latest
null-safe version.
```yaml
dependencies:
stream_chat_flutter_core: ^2.0.0
```
Upon doing this, all breaking changes from the package will take immediate effect. Here are steps to
remedy the issue:
:::note
The major changes in `stream_chat_flutter_core` consist of changing over from a map full of options
to a more type safe and sound approach by changing over to explicit parameters.
:::
1) Change over Core widget implementations by using the explicit parameters instead of the options map.
Use these explicit parameters in the widget constructor instead of the option keys:
* options.state -> bool state
* options.watch -> bool watch
* options.presence -> bool presence
2) Change over query calls in the BLoCs in the same way (change from options map to explicit parameters
in the constructor)
### Changelog of `stream_chat`
#### 🛑️ Breaking Changes from 1.5.3
* Migrate this package to null safety
* ConnectUserWithProvider now requires tokenProvider as a required param. (Removed from the constructor)
* client.disconnect() is now divided into two different functions
* client.closeConnection() -> for closing user websocket connection.
* client.disconnectUser() -> for disconnecting user and resetting client state.
* client.devToken() now returns a Token model instead of String.
* ApiError is removed in favor of StreamChatError
* StreamChatError -> parent type for all the stream errors.
* StreamWebSocketError -> for user websocket related errors.
* StreamChatNetworkError -> for network related errors.
* client.queryChannels(), channel.query() options param is removed in favor of individual params
* option.state -> bool state
* option.watch -> bool watch
* option.presence -> bool presence
* client.queryUsers() options param is removed in favor of individual params
* option.presence -> bool presence
* Migrate this package to null safety
* Added typed filters
#### 🐞 Fixed
* #369: Client does not return without internet connection
* several minor fixes
* performance improvements
#### ✅ Added
* New Location enum is introduced for easily changing the client location/baseUrl.
* New client.openConnection() and client.closeConnection() is introduced to connect/disconnect user ws connection.
* New client.partialUpdateMessage and channel.partialUpdateMessage methods
* connectWebSocket parameter in connect user calls to use the client in "connection-less" mode.
#### 🔄 Changed
* baseURL is now deprecated in favor of using Location to change data location.