feat: Introduce StacTooltipThemeData and parser#399
feat: Introduce StacTooltipThemeData and parser#399divyanshub024 merged 2 commits intoStacDev:devfrom
Conversation
WalkthroughAdds StacTooltipThemeData model (JSON-serializable), wires it into StacTheme, adds a parser to convert StacTooltipThemeData → Flutter's TooltipThemeData, and exports the new model and parser. Changes
Sequence Diagram(s)sequenceDiagram
participant JSON as Theme JSON
participant Model as StacTooltipThemeData
participant Parser as StacTooltipThemeData.parse
participant Theme as StacTheme -> ThemeData
JSON->>Model: StacTooltipThemeData.fromJson(...)
Model->>Parser: .parse(context)
Parser->>Theme: returns TooltipThemeData
Theme->>ThemeData: ThemeData(tooltipTheme: TooltipThemeData)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
packages/stac/lib/src/parsers/theme/stac_theme_parser.dart(2 hunks)packages/stac/lib/src/parsers/theme/stac_tool_tip_theme_data_parser.dart(1 hunks)packages/stac/lib/src/parsers/theme/themes.dart(2 hunks)packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.dart(3 hunks)packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.g.dart(2 hunks)packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.dart(1 hunks)packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.g.dart(1 hunks)packages/stac_core/lib/foundation/theme/theme.dart(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: format
- GitHub Check: analyze
🔇 Additional comments (7)
packages/stac/lib/src/parsers/theme/themes.dart (1)
29-30: LGTM!The exports for
StacTooltipThemeDataand its parser follow the established pattern for other theme data types in this barrel file.Also applies to: 59-59
packages/stac_core/lib/foundation/theme/theme.dart (1)
31-31: LGTM!The export for the new tooltip theme data follows the established pattern for other theme data modules in this library barrel file.
packages/stac/lib/src/parsers/theme/stac_theme_parser.dart (1)
30-30: LGTM!The import and parsing integration follow the established pattern used by other theme components in this parser. The null-safe call chain properly handles the optional
tooltipThemefield.Also applies to: 129-129
packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.dart (1)
31-31: LGTM!The
tooltipThemefield is properly integrated intoStacThemewith appropriate documentation, nullable typing, and consistent placement within the component themes section.Also applies to: 159-159, 375-377
packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.dart (1)
1-106: LGTM!The
StacTooltipThemeDatamodel is well-structured with comprehensive field coverage for Flutter'sTooltipThemeData. Documentation with both Dart and JSON examples is helpful. The implementation correctly follows the established patterns for other Stac theme data models.packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.g.dart (1)
197-201: LGTM!The generated serialization code correctly handles the new
tooltipThemefield with proper null-safety, following the same pattern as other nested theme data types.Also applies to: 264-264
packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.g.dart (1)
1-83: Generated code structure looks correct.This is properly generated code from
json_serializable. The deserialization (lines 9–48) correctly handles null safety with null checks before callingfromJson()on nested objects, proper numeric conversions with?.toDouble(), and nullable enum handling via$enumDecodeNullable(). The serialization (lines 50–68) maintains symmetry and uses null-safe operators (?.toJson()). Enum maps (lines 70–83) appear complete for their respective enums.Please verify that both enum maps (
StacTextAlignandStacTooltipTriggerModeat lines 70–83) cover all values in the corresponding Dart enum definitions to ensure exhaustiveness and prevent serialization bugs.#!/bin/bash # Verify enum maps cover all enum values # Find the enum definitions for StacTextAlign rg -A 10 'enum\s+StacTextAlign\s*\{' --type=dart # Find the enum definitions for StacTooltipTriggerMode rg -A 10 'enum\s+StacTooltipTriggerMode\s*\{' --type=dart
packages/stac/lib/src/parsers/theme/stac_tool_tip_theme_data_parser.dart
Show resolved
Hide resolved
|
Hi @divyanshub024 , @Potatomonsta 👋, |
divyanshub024
left a comment
There was a problem hiding this comment.
Once again, thank you for your amazing contribution 🎉 💯
Thank you! I’m glad to have been able to contribute. |
* feat: Introduce StacTooltipThemeData and parser * fix: remove unused deprecated height from StacTooltipThemeData
Description
Add support for
StacTooltipThemeDatain Stac.Type of Change
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.