Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ document; the section link is provided.
positional `bool` at a call site tells the reader nothing.
- File names are `snake_case.dart` (`file_names`). Imports follow the standard order:
`dart:` → `package:` → relative — one blank line between groups (`directives_ordering`).
- Web conditional imports select the web file with `dart.library.js_interop`, never
`dart.library.html`, which does not exist under `dart2wasm`.
→ [Web conditional imports use `js_interop`, not `html`](#web-conditional-imports-use-js_interop-not-html)
- Public API members require dartdoc (`///`). Private members (`_`-prefixed) use `//`
block comments, not `///`. → [Private members use `//`](#private-members-use--not-)
- Default to zero inline `//` comments in implementation. Prefer well-named locals and
Expand Down Expand Up @@ -926,6 +929,33 @@ Consuming streams in widgets:
only rebuilds when the value changes.
- Always cancel `StreamSubscription`s in `dispose()`.

### Web conditional imports use `js_interop`, not `html`

Conditional imports that swap in a web implementation key on `dart.library.js_interop`:

```dart
// GOOD
import 'foo_stub.dart'
if (dart.library.js_interop) 'foo_web.dart'
if (dart.library.io) 'foo_io.dart';

// BAD
import 'foo_stub.dart'
if (dart.library.html) 'foo_web.dart'
if (dart.library.io) 'foo_io.dart';
```

`dart:html` does not exist under `dart2wasm`, and neither does `dart:io`. On a
WebAssembly build the bad form therefore matches no condition and silently resolves to
the stub. It still compiles cleanly; the failure appears only at runtime, when the stub
throws `UnimplementedError`. `dart2js` supports both constants, so `js_interop` covers
JS and Wasm alike.

Nothing in the analyzer catches this. `avoid_web_libraries_in_flutter` inspects import
URIs, and a condition is not a URI — so the bad form produces no warning.

The same applies to `export` directives.


## Testing

Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linter:
- avoid_relative_lib_imports
- avoid_slow_async_io
- avoid_types_as_parameter_names
- avoid_web_libraries_in_flutter
- cancel_subscriptions
- close_sinks
- control_flow_in_finally
Expand Down
8 changes: 2 additions & 6 deletions docs/docs_screenshots/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ dependencies:
flutter:
sdk: flutter
record: ^6.2.0
stream_chat_flutter: ^10.3.0
stream_core_flutter:
git:
url: https://github.com/GetStream/stream-core-flutter.git
ref: 4b7ed86a52c3109fad0a6f5118120082e378c610
path: packages/stream_core_flutter
stream_chat_flutter: ^10.4.0
stream_core_flutter: ^0.5.1

dev_dependencies:
alchemist: ^0.14.0
Expand Down
4 changes: 2 additions & 2 deletions docs/docs_screenshots/test/channel/channel_preview_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void main() {
foregroundColor: colorScheme.textPrimary,
backgroundColor: colorScheme.backgroundSurface,
onPressed: (_) {},
child: Icon(icons.more, size: 20),
child: Icon(icons.moreHorizontal, size: 20),
),
CustomSlidableAction(
foregroundColor: colorScheme.textOnAccent,
Expand Down Expand Up @@ -350,7 +350,7 @@ void main() {
foregroundColor: colorScheme.textPrimary,
backgroundColor: colorScheme.backgroundSurface,
onPressed: (_) {},
child: Icon(icons.more, size: 20),
child: Icon(icons.moreHorizontal, size: 20),
),
CustomSlidableAction(
foregroundColor: colorScheme.textOnAccent,
Expand Down
10 changes: 5 additions & 5 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ command:
share_plus: ">=12.0.2 <14.0.0"
shimmer: ^3.0.0
sqlite3_flutter_libs: ^0.5.26
stream_chat: ^10.3.0
stream_chat_flutter: ^10.3.0
stream_chat_flutter_core: ^10.3.0
stream_chat_localizations: ^10.3.0
stream_chat_persistence: ^10.3.0
stream_chat: ^10.4.0
stream_chat_flutter: ^10.4.0
stream_chat_flutter_core: ^10.4.0
stream_chat_localizations: ^10.4.0
stream_chat_persistence: ^10.4.0
streaming_shared_preferences: ^2.0.0
svg_icon_widget: ^0.0.1
stream_core:
Expand Down
13 changes: 13 additions & 0 deletions packages/stream_chat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@

- Added the OpenAPI-generated v2 client under `lib/open_api/`, along with the `melos run gen:openapi` tooling that produces it. No API uses it yet.

🐞 Fixed

- Fixed `CurrentPlatform` throwing `UnimplementedError` on WebAssembly builds.
- Fixed live location expiry emitting repeated `location.expired` events for the same expired location.

## 10.4.0

✅ Added

- Added `Event.channelMemberCount`, exposing the server-provided `channel_member_count` field on channel events (e.g. `member.added`, `member.removed`, `member.updated`).

🔄 Changed

- `Channel.translateMessage` now merges the translated message into the channel state, so the translation reaches anything watching the channel without the caller applying the response itself.
- Raised minimum Dart SDK to `^3.12.0`.
- `Channel` and `ClientState` streams that expose a single primitive value are now distinct, so they only emit when the value actually changes. Affects `Channel.memberCountStream`, `messageCountStream`, `watcherCountStream`, `cooldownStream`, `nameStream`, `imageStream`, `frozenStream`, `disabledStream`, `hiddenStream`, `isPinnedStream`, `isArchivedStream`, `createdAtStream`, `updatedAtStream`, `deletedAtStream`, `truncatedAtStream`, `lastMessageAtStream`, and `ClientState.totalUnreadCountStream`, `unreadChannelsStream`, `unreadThreadsStream`.

🐞 Fixed

- Fixed `Channel.memberCount` / `memberCountStream` staying stale for the rest of the session after members joined or left; channel events now apply the server-provided member count, the same way `messageCount` already did.
- Fixed reconnect state recovery surfacing an uncatchable error when the connection dropped again mid-recovery; it is now logged, and `connection.recovered` still fires. [#2910](https://github.com/GetStream/stream-chat-flutter/issues/2910)
- Fixed every failed websocket connect leaving an unhandled error in the root zone, which crash reporters listening on `PlatformDispatcher.onError` report as a fatal crash. [#2921](https://github.com/GetStream/stream-chat-flutter/issues/2921)

Expand Down
2 changes: 1 addition & 1 deletion packages/stream_chat/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
cupertino_icons: ^1.0.3
flutter:
sdk: flutter
stream_chat: ^10.3.0
stream_chat: ^10.4.0

dependency_overrides:
stream_chat:
Expand Down
Loading
Loading