feat(ui): add child support to StreamBadgeNotification and StreamBadgeCount#102
feat(ui): add child support to StreamBadgeNotification and StreamBadgeCount#102
Conversation
…eCount Allow badge components to wrap a child widget with configurable alignment and offset, matching the pattern used by StreamOnlineIndicator. Also removes alignment/offset from StreamOnlineIndicatorThemeData as these are layout concerns, not styling. Made-with: Cursor
📝 WalkthroughWalkthroughBadge components now support optional Changes
Sequence DiagramsequenceDiagram
participant Client
participant StreamBadge as Badge Component
participant Stack
participant Align
participant Transform
Client->>StreamBadge: new StreamBadge(child, alignment, offset)
alt child is null
StreamBadge-->>Client: return badge only
else child is provided
StreamBadge->>Stack: Stack(children: [child, badge])
Stack->>Align: Align(alignment, child: Transform)
Align->>Transform: Transform.translate(offset, child: badge)
Transform-->>Stack: positioned badge
Stack-->>Client: wrapped layout
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (8.69%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #102 +/- ##
==========================================
- Coverage 24.73% 24.68% -0.06%
==========================================
Files 152 152
Lines 5623 5639 +16
==========================================
+ Hits 1391 1392 +1
- Misses 4232 4247 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart (1)
136-147:⚠️ Potential issue | 🟡 MinorDocumentation references removed theme properties.
The docstrings for
alignmentandoffsetinStreamOnlineIndicatorPropsstill referenceStreamOnlineIndicatorThemeData.alignmentandStreamOnlineIndicatorThemeData.offset, but these properties have been removed from the theme data class.📝 Suggested documentation fix
/// The alignment of the indicator relative to [child]. /// /// Only used when [child] is provided. - /// Falls back to [StreamOnlineIndicatorThemeData.alignment], or - /// [AlignmentDirectional.topEnd]. + /// Defaults to [AlignmentDirectional.topEnd]. final AlignmentGeometry? alignment; /// The offset for fine-tuning indicator position. /// /// Applied after [alignment] to adjust the indicator's final position. - /// Falls back to [StreamOnlineIndicatorThemeData.offset], or [Offset.zero]. + /// Defaults to [Offset.zero]. final Offset? offset;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart` around lines 136 - 147, The docstrings for StreamOnlineIndicatorProps.alignment and StreamOnlineIndicatorProps.offset incorrectly reference removed properties StreamOnlineIndicatorThemeData.alignment and StreamOnlineIndicatorThemeData.offset; update these comments to reference the current theme fallback (remove or replace the removed property names), e.g., state that they fall back to the theme's values via StreamOnlineIndicatorThemeData (or simply to the default AlignmentDirectional.topEnd and Offset.zero) and ensure the docstrings mention only existing API symbols such as StreamOnlineIndicatorProps.alignment, StreamOnlineIndicatorProps.offset, and StreamOnlineIndicatorThemeData (without the removed .alignment/.offset members).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In
`@packages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dart`:
- Around line 136-147: The docstrings for StreamOnlineIndicatorProps.alignment
and StreamOnlineIndicatorProps.offset incorrectly reference removed properties
StreamOnlineIndicatorThemeData.alignment and
StreamOnlineIndicatorThemeData.offset; update these comments to reference the
current theme fallback (remove or replace the removed property names), e.g.,
state that they fall back to the theme's values via
StreamOnlineIndicatorThemeData (or simply to the default
AlignmentDirectional.topEnd and Offset.zero) and ensure the docstrings mention
only existing API symbols such as StreamOnlineIndicatorProps.alignment,
StreamOnlineIndicatorProps.offset, and StreamOnlineIndicatorThemeData (without
the removed .alignment/.offset members).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 17ea7269-778a-4c6e-8476-f54bdb828973
📒 Files selected for processing (9)
apps/design_system_gallery/lib/components/badge/stream_badge_count.dartapps/design_system_gallery/lib/components/badge/stream_badge_notification.dartapps/design_system_gallery/lib/components/badge/stream_online_indicator.dartpackages/stream_core_flutter/CHANGELOG.mdpackages/stream_core_flutter/lib/src/components/badge/stream_badge_count.dartpackages/stream_core_flutter/lib/src/components/badge/stream_badge_notification.dartpackages/stream_core_flutter/lib/src/components/badge/stream_online_indicator.dartpackages/stream_core_flutter/lib/src/theme/components/stream_online_indicator_theme.dartpackages/stream_core_flutter/lib/src/theme/components/stream_online_indicator_theme.g.theme.dart
💤 Files with no reviewable changes (1)
- packages/stream_core_flutter/lib/src/theme/components/stream_online_indicator_theme.dart
Description of the pull request
Allow badge components to wrap a child widget with configurable alignment and offset, matching the pattern used by StreamOnlineIndicator. Also removes alignment/offset from StreamOnlineIndicatorThemeData as these are layout concerns, not styling.
Summary by CodeRabbit
New Features
Breaking Changes