docs(repo): add STYLE_GUIDE.md and TESTING.md adapted from Flutter's guides#125
docs(repo): add STYLE_GUIDE.md and TESTING.md adapted from Flutter's guides#125xsahil03x wants to merge 25 commits into
Conversation
…guides Adapts Flutter's Style-guide-for-Flutter-repo and Writing-Effective-Tests for stream-core-flutter, with divergences called out inline. CLAUDE.md now opens with a pointer directing agents to read both docs before writing or reviewing code. Repo-specific rules captured beyond the Flutter guide: - Public barrel contract (core.dart / chat.dart, check:barrels lint). - Relative imports inside lib/src/ (always_use_package_imports disabled). - Component + theme + golden + Widgetbook use-case are all shipped together for every new widget. - Theme system: @themeGen for component themes, @ThemeExtensions for the root StreamTheme (which is itself the ThemeExtension, no separate StreamThemeData); defaults live in the widget's build via null-coalescing, mirroring Flutter's AppBar/TabBar pattern. - Icons are generated from SVGs; melos run generate:icons. - CHANGELOG labels: `### ✨ Features`, `### 🐛 Bug Fixes`, `### 🛑 Breaking / Removals`. - Assert messages not required (prefer_asserts_with_message disabled). - `avoid_print` disabled repo-wide but prefer `debugPrint` in Flutter code. Divergences from Flutter's guide: - Line width 120 (not 100). - Relative imports inside lib/src/ (Flutter's guide requires package: imports). - Bare `// ignore:` and `// TODO:` (Flutter requires rationale / handle). - Streams are the primary reactive primitive for real-time data (Flutter prefers Listenable inside framework). - Private members use `//`, not `///`. Verified against actual repo state before publishing: component category list matches lib/src/components, Widgetbook use-cases live under apps/design_system_gallery/lib/components (not /use_cases), root theme is StreamTheme (not StreamThemeData), StreamAvatarSize values checked, no BetterStreamBuilder reference (it lives in stream-chat-flutter, not here). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughAdds documentation only: CLAUDE.md gains a pointer to a new STYLE_GUIDE.md; STYLE_GUIDE.md introduces a comprehensive Dart/Flutter/Widgetbook style guide for the monorepo covering API design, coding, testing, naming, formatting, and design-system conventions; TESTING.md adds a guide on writing effective tests. ChangesDocumentation additions
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Test files live at `test/components/<category>/<name>_test.dart` (or `_golden_test.dart` for the golden variant), not `test/components/<name>/` as previously claimed. Verified against packages/stream_core_flutter/test. - Golden config: only `goldens/ci/*.png` gets committed; platform goldens (e.g. `goldens/macos/`) are auto-generated locally by alchemist and gitignored. Fixed the misleading "for local macOS development" phrasing and explained the actual flutter_test_config.dart setup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
=======================================
Coverage 37.26% 37.26%
=======================================
Files 175 175
Lines 6986 6986
=======================================
Hits 2603 2603
Misses 4383 4383 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Barrel contract: reframe as extensible — chat.dart is one of possibly many product barrels (video.dart, feeds.dart, ...) added as new Stream products need domain-specific widgets. Adjusts wording and rules to cover the general pattern. - Style vs ThemeData: name the actual convention. Top-level component themes use <Component>ThemeData; sub-configurations nested inside them use <Component>Style. Grandfathered top-level Style themes exist; don't add more. - Widget essentials: explicitly aspirational for new widgets — some earlier components predate parts of the checklist; close gaps opportunistically, don't block landings on backfill. - Component factory: name the concrete reference (StreamMessageBubble + StreamComponentFactory.of(context).messageBubble) so a contributor has a working example to copy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
STYLE_GUIDE.md (1)
253-257: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the public logger export in the style guide
packages/stream_core/lib/stream_core.dartalready exportssrc/logger.dart, so point readers atpackage:stream_core/stream_core.dartinstead of the internalstream_core/src/logger/path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@STYLE_GUIDE.md` around lines 253 - 257, The style guide currently points readers to the internal logger path, but the public export already exists. Update the guidance in STYLE_GUIDE.md to reference the Logger via package:stream_core/stream_core.dart instead of stream_core/src/logger/, and keep the note about using debugPrint in stream_core_flutter where appropriate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@STYLE_GUIDE.md`:
- Around line 1117-1130: The deliverables checklist is inconsistent because it
enumerates five required items but ends with “any of the four.” Update the
summary in STYLE_GUIDE.md to say “any of the five” so it matches the listed
deliverables (Widget file, Theme file, Golden test, Widgetbook use-case, and
Barrel export).
---
Nitpick comments:
In `@STYLE_GUIDE.md`:
- Around line 253-257: The style guide currently points readers to the internal
logger path, but the public export already exists. Update the guidance in
STYLE_GUIDE.md to reference the Logger via package:stream_core/stream_core.dart
instead of stream_core/src/logger/, and keep the note about using debugPrint in
stream_core_flutter where appropriate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 14be598c-ffda-4ad9-8419-54928c9b02a3
📒 Files selected for processing (3)
CLAUDE.mdSTYLE_GUIDE.mdTESTING.md
Verified against the SDK: only one extension on a common Dart type exists (DistanceExtension on num, for units-of-measure ergonomics). BuildContext extensions for scoped lookups (StreamThemeExtension, StreamComponentFactoryExtension) also exist and are idiomatic. Rewrote the rule to name both patterns as accepted, plus the general "avoid" list still stands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…l utils Reviewed packages/stream_core/lib/src/utils/: - Extensions section: my rule was way off. The repo has an intentional standard-library-style extension layer (Standard on T for let/apply/ takeIf, IterableExtensions, ListExtensions, SortedListExtensions, ComparableExtension) exported from stream_core.dart and used in 100+ files. Rewrote the section to describe the layer, direct new utility work into utils/, and keep the "avoid" list narrower. - Reactive primitives: raw Stream + ValueNotifier framing was wrong. The repo uses SharedEmitter (SharedFlow-equivalent) and StateEmitter (StateFlow-equivalent) as its primary reactive types — both implement Stream<T> under the hood. Rewrote to describe when to reach for each, with StateEmitter preferred over ValueNotifier for cross-boundary state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The reactive-state and product-SDK guidance was framed around
SharedEmitter/StateEmitter — that's stream_core's transport-layer
internals, not the pattern new product SDKs should follow. Reviewed
stream-feeds-flutter's AGENTS.md (the current reference for "latest
architecture") and refactored the guide:
- Reactive state now has three explicit layers:
1. Product-SDK state → StateNotifier (from package:state_notifier)
with @freezed State classes. Points at stream-feeds-flutter as the
reference. Client → Repository → StateNotifier → State.
2. Transport-layer state → existing SharedEmitter/StateEmitter (kept
documented; not deprecated, just scoped to internal WS/connection
state).
3. Widget-owned state → ValueNotifier/ChangeNotifier (unchanged).
- New section: "Error handling with Result<T>". Verified this is already
an established convention here (StreamAttachmentUploader, CdnClient
already return Future<Result<T>>). Repository/public methods return
Result; never throw across SDK boundary.
- New section: "Reference architecture: stream-feeds-flutter". Diagrams
the Client/Repository/StateNotifier/State layering and points at the
feeds AGENTS.md for the full pattern (freezed 3.0 mixed mode,
*Data / *Query / *Request naming, public/internal split).
- Testing section adds a note for product-SDK tests: public-API-only,
typed test helpers (feedsClientTest / feedTest), mock exact requests
not any(). All mirrors feeds's testing philosophy.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The user is going to write a dedicated style guide in the feeds repo itself. The architectural guidance stays (StateNotifier for new state, Result pattern, Client/Repository/StateNotifier/State layering, freezed 3.0 mixed mode, *Data/*Query/*Request naming, public-API-only testing, mock-exact-requests) but is now presented as generic Stream SDK patterns rather than "the pattern documented in feeds": - "Reference architecture: stream-feeds-flutter" section renamed to "Product-SDK architecture" and no longer links to feeds AGENTS.md. - Reactive-state section no longer names feeds as the reference implementation. - Testing section no longer names feedsClientTest / feedTest; instead says each product SDK ships its own `<Product>ClientTest` / `<Product>Test` helper. - Kept the forward-looking `feeds.dart` mention in the barrel section as an example of a possible future product barrel — not a link. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reviewed against Flutter's original style guide, which favours short rules + code samples over long prose. Applied to the three most verbose sections: - Reactive state (was 55 lines of layered prose): collapsed to 20 lines, three bullets + a short paragraph. No new information; just tighter. - Guidelines for extensions (was 45 lines with a bulleted list of every helper in utils/): tightened to 20 lines with the utils-layer as a single sentence and three positive extension patterns as bullets. - Theme system (was 60 lines of numbered steps with prose): rewrote around two code samples — the theme file skeleton (annotation, mixin, InheritedTheme, of() lookup with merge) and the widget consumption pattern (null-coalescing defaults in build). Code carries the shape; prose only explains what code can't show. Added code samples where they replaced prose: - Product-SDK architecture: added a StateNotifier + @freezed State + public-wrapper skeleton so a contributor has a copy-paste starting point. - Error handling with Result<T>: added a repository-method sample and a consumer switch pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
StateNotifier isn't a divergence from Flutter's Listenable-over-Stream guidance. It's the pure-Dart equivalent of ValueNotifier, used only because Listenable lives in package:flutter/foundation.dart and can't be reached from a pure-Dart LLC. In the Flutter widget layer we still use ValueNotifier / ChangeNotifier, matching Flutter's own conventions. Rewrote the Reactive state section to say this explicitly: - Pure-Dart product SDKs: StateNotifier (= ValueNotifier for pure Dart). - Flutter widget code: ValueNotifier / ChangeNotifier. - Transport internals only: SharedEmitter / StateEmitter. Removed the "This intentionally diverges from Flutter's style guide" paragraph — Flutter's guide is about avoiding streams inside framework code, which is different from what we do here. Also tagged Product-SDK architecture as "pure-Dart product SDKs" so readers don't apply the Client → Repository → StateNotifier layering to Flutter UI packages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
stream-core-flutter is transport + design system; it doesn't own a state layer. The Client → Repository → StateNotifier → State architecture applies to product SDKs built on top (Chat LLC, Feeds LLC, ...), not to this repo. Documenting it here bloats the guide with patterns that belong in each product SDK's own guide. - Deleted the whole "Product-SDK architecture" section (~55 lines). - Trimmed the reactive-state section to just what this repo actually uses: SharedEmitter/StateEmitter for transport internals and ValueNotifier/ChangeNotifier for widget-owned state. StateNotifier moved out; it's a product-SDK concern. - Trimmed the Result<T> section: no more "repositories, clients" — just "public methods that can fail". Sample code now uses CdnClient (which actually exists here) instead of a fictional User API. - Removed the product-SDK paragraph from the Testing section for the same reason. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tually follow The Flutter-guide "Each API should be self-contained and should not know about other features" doesn't describe stream-core-flutter's design system. Components compose deliberately here — StreamComponentFactory ties them together, the theme hierarchy (primitives → semantics → components) is composition-first, and message-layer widgets reference each other by design. Renamed the section to "Prefer immutable data", kept the parts that are actually true (immutable value classes and copyWith, agnostic `child` parameters), and added a note calling out that inter-component coupling is intentional in the design system layer, not a violation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ng we actually follow" This reverts commit 4395eb0.
Previous opening warned "misuse pollutes IDE suggestions, reach for a regular method first" and then celebrated a standard-library-style extension layer we use freely. The two didn't square. Rewrote to lead with what we actually do (add to utils/), then list accepted extension targets outside utils/, then the actual "avoid" list, and finally a narrower note about static resolution (framed as "when to use an instance method instead" — not as a blanket caution). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The section was violating the guide's own "docs describe the contract, not implementation" rule — enumerating internal classes (Standard, IterableExtensions, ListExtensions, ...), naming specific methods (let/also/apply/takeIf), citing a "100+ call sites" stat, and giving concrete examples like AttachmentFile / DioException / DistanceExtension. Rewrote to state the rule abstractly: new utility extensions go in utils/, accepted extension targets described by category (domain types, BuildContext, primitives for units-of-measure), and the avoid list stays as-is. One file path reference is kept because contributors need to know where to add code. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The `stream_core/lib/src/utils/` path is also implementation detail — if the layer ever moves, the guide would lie. Refer to it as "the shared utils layer" and let contributors navigate to it the same way they'd navigate to any other convention in the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same treatment as the extensions section: it's a guide, not impl detail. Removed the internal file path (stream_core/lib/src/utils/), the internal class enumeration (SharedEmitter, StateEmitter, MutableSharedEmitter, MutableStateEmitter), the SharedFlow/StateFlow educational aside, and the internal package reference (stream_core_flutter). Kept public Flutter/Dart types (Listenable, ValueNotifier, ChangeNotifier, StreamSubscription) — those are the contract callers work against. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ection Symmetric with how we already name Listenable / ValueNotifier / ChangeNotifier for the Flutter layer. Both are the exposed contract for their respective layers; either name both or name neither. Kept the mutable-flavor types (MutableSharedEmitter, MutableStateEmitter) out — those are implementation detail; the read-only interfaces are the contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-types warning Replaced our reworked extensions section with Flutter's original text from the style guide. Kept everything up through the collision rule; dropped the "Avoid creating public extension methods on common types from the Dart SDK" paragraph, because we intentionally maintain a shared utils layer that extends common types (Standard on T, IterableExtensions, etc.), and warning against it would contradict established practice here. Also changed "separate Flutter libraries" to "separate libraries" — the surrounding text is now generic, and the Flutter framing was tied to the source repo, not to our conventions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
STYLE_GUIDE.md (1)
1153-1174: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the checklist count to five.
The list now has five required deliverables, so “any of the four” is stale and makes the policy inconsistent.
Suggested fix
- Missing any of the four is a review-blocker. + Missing any of the five is a review-blocker.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@STYLE_GUIDE.md` around lines 1153 - 1174, The checklist in STYLE_GUIDE.md is outdated and still says “any of the four” even though the required deliverables now total five. Update the closing policy text in the component deliverables list to reflect five items, and keep the wording consistent with the existing bullets around Widget file, Theme file, tests, Widgetbook use-case, and Barrel export so the review-blocker rule matches the current requirements.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@STYLE_GUIDE.md`:
- Around line 1153-1174: The checklist in STYLE_GUIDE.md is outdated and still
says “any of the four” even though the required deliverables now total five.
Update the closing policy text in the component deliverables list to reflect
five items, and keep the wording consistent with the existing bullets around
Widget file, Theme file, tests, Widgetbook use-case, and Barrel export so the
review-blocker rule matches the current requirements.
- Renamed "Reactive state" to "Use of streams and Listenables", matching
Flutter's parallel section shape ("Use of streams in Flutter framework
code"). The rule is now: at the Flutter widget layer, prefer Listenable
subclasses over Stream, for the reasons Flutter cites (heavy API, no
current-value accessor, non-trivial transformers). At the transport
layer, streams are the natural primitive — SharedEmitter/StateEmitter.
- Removed "we prefer" / "we" phrasing throughout — the guide states
rules, not preferences.
- Removed the meta trailer about product SDKs choosing their own
primitives — that's commentary about other guides, not a rule that
applies to code in this repo.
- Removed the Error handling with Result<T> section entirely. Result is
used in a few transport-layer places (CDN client, attachment
uploader) rather than as a repo-wide convention, so it doesn't need
to be a first-class rule.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previous wording claimed transport-layer state has "no meaningful current value at every moment", which is wrong: StateEmitter has .value (Kotlin StateFlow equivalent) and SharedEmitter supports replay for late subscribers. Fixed the paragraph to describe what each primitive actually does. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ams section The bullet came from Flutter's original guide, where it holds because Flutter only has raw Stream<T>. Here, StateEmitter extends Stream<T> and exposes .value, so the blanket "streams don't have a current-value accessor" reads as inconsistent with the transport-layer paragraph below that names StateEmitter's current-value accessor. The remaining two bullets (heavy API, non-trivial transformers) still support the widget-layer preference for Listenable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…m vs Listenable Rule is: never use raw Stream in this repo, always the emitters. Which makes the Flutter-style "Stream vs Listenable at widget layer" framing the wrong shape. Rewrote as "two primitives cover reactive state": - SharedEmitter / StateEmitter for stream-like reactive data. - Listenable subclasses for widget-owned state at the Flutter layer. Ends with the explicit rule: don't use raw Stream directly, reach for emitters. Section renamed from "Use of streams and Listenables" to "Reactive primitives" — the previous title was inaccurate since we're prescribing against raw streams. Dropped the "streams have heavy API / non-trivial transformers" justification bullets — they argued for Listenable over raw Stream, which is no longer the choice a contributor has to make. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reworked the section to mirror Flutter's "Use of streams in Flutter framework code" structure and cadence: opens with "In general we avoid", notes streams are fine in general, gives the reasons via "For example:" bullets, concludes with "We generally prefer" naming the preferred alternative. Header changed to "Use of `Stream`s" to match Flutter's title shape. Body names our two emitter primitives (SharedEmitter for broadcast, StateEmitter for state with a current value), and adds a short trailing paragraph for the Flutter widget layer's Listenable preference. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ecklists Final cleanup pass after full-doc review. Three categories: Philosophy — dropped four Flutter aphorisms that don't guide anyone reviewing code here (Avoid interleaving multiple concepts together, Prefer general APIs but use dedicated APIs where there is a reason, Avoid heuristics and magic, Solve real problems by literally solving a real problem). Renamed "Getters feel faster than methods" to "Getters should be cheap" and tightened it around what the rule actually is. Impl-detail leaks — dropped RxDart/Dio from the Layers and Monorepo layout diagrams (now say "pure Dart transport layer"). Removed the internal Logger path and the analysis_options lint-state trivia from "Only log actionable messages". Component factory section no longer names specific file paths or the StreamMessageBubble reference — describes the pattern abstractly. Component structure section no longer enumerates all 17 category directories (drifts on every new one). "Where to look" Design tokens bullet drops the internal path. Redundancy — folded Widget essentials into Component structure. The two sections were doubling up on tests / Widgetbook / docs. Now one section covers "each component ships with" (artifacts) and "the widget itself should" (behavior). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The guide is advice by design — cutting Philosophy sections because they were "abstract" was the wrong move. Restored: - Prefer general APIs, but use dedicated APIs where there is a reason. - Avoid heuristics and magic. - Solve real problems by literally solving a real problem. (Dropped the "internal Stream product team / external integrator" audience-mismatch parenthetical; kept the core advice.) Also added a small "Prefer immutable data" section for the two rules that lived inside the deleted "Avoid interleaving" section — widgets agnostic about their `child`'s runtime type, and immutable value classes via copyWith. The abstract "Each API self-contained, no knowledge of other features" framing stays deleted (we don't follow it), but the two concrete rules under it are preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
STYLE_GUIDE.mdat the repo root — a canonical style guide adapted from Flutter's repo style guide, reshaped for the design-system + LLC-transport structure of this repo.TESTING.mdat the repo root — a companion doc on how to write good tests adapted from Flutter's Writing-Effective-Tests.CLAUDE.mdto open with a pointer directing AI agents to readSTYLE_GUIDE.mdbefore writing or reviewing code, plus aTESTING.mdlink for test-writing tasks.Mirrors the equivalent PR in stream-chat-flutter #2793, tuned for this repo's actual conventions.
What's in STYLE_GUIDE
lib/src/, private-member commenting, changelog labels, noInheritedWidgetlookup ininitState, named boolean parameters,file_names,directives_ordering).stream_core→stream_core_flutter), avoiding secret state, error-message quality, streams as primary reactive primitive for real-time data.core.dartvschat.dart,melos run check:barrelsenforcement).//not///).prefer_asserts_with_messageis disabled), dispose lifecycle, equality boilerplates, dot shorthands,strict-inference/strict-raw-typesimplications, noInheritedWidgetlookup ininitState, early-return pattern, relative-imports convention.mocktail,alchemistgolden tests,test/components/<name>/goldens/{ci,macos}layout. Points atTESTING.mdfor writing-style guidance.@themeGenfor component themes vs@ThemeExtensions(constructor: 'raw', ...)for the rootStreamTheme, defaults in widgetbuild(Flutter'sAppBar/TabBarpattern), icon generation from SVGs.What's in TESTING.md
Four principles from Flutter's Writing-Effective-Tests with Stream-Core-flavoured examples using
StreamAvatar,StreamAvatarSize,StreamMessageBubble:Divergences from Flutter's guide
Called out inline every time; the notable ones:
lib/src/— this repo hasalways_use_package_imports: false. Flutter's guide requirespackage:imports; we prefer relative paths inside a package for refactor safety.// ignore:directives and bare// TODO:(with optional category tag likeTODO(localize):, not GitHub handles) match repo practice.prefer_asserts_with_messageis disabled here.Listenable; that reasoning doesn't apply to a real-time transport layer.//, not///.Verified against the repo before merging
StreamTheme(extendsThemeExtension<StreamTheme>) — there is noStreamThemeData. Fixed in the guide.lib/src/components/(17 categories, not the 10 previously in CLAUDE.md).apps/design_system_gallery/lib/components/, not/use_cases/.StreamAvatarSizeenum values (xs, sm, md, lg, xl, xxl) — the switch example uses correct radii.BetterStreamBuilderreference (that class lives instream-chat-flutter, not here).StreamAvatar,StreamAvatarSize,StreamMessageBubble,StreamWsClient).### ✨ Features,### 🐛 Bug Fixes,### 🛑 Breaking / Removals) match current package changelogs, with grandfathered### 🐞 Fixed/### 💥 BREAKING CHANGESnoted.@themeGenfor component themes and@ThemeExtensions(constructor: 'raw', ...)for the root — verified againststream_theme.dartandstream_avatar_theme.dart.Test plan
TESTING.mdend-to-end — it's short (~210 lines).check_barrels.yamlintent.🤖 Generated with Claude Code
Summary by CodeRabbit