Skip to content

feat: Introduce StacTooltipThemeData and parser#399

Merged
divyanshub024 merged 2 commits intoStacDev:devfrom
akhil-ge0rge:feat-tool-tip-theme
Dec 19, 2025
Merged

feat: Introduce StacTooltipThemeData and parser#399
divyanshub024 merged 2 commits intoStacDev:devfrom
akhil-ge0rge:feat-tool-tip-theme

Conversation

@akhil-ge0rge
Copy link
Contributor

@akhil-ge0rge akhil-ge0rge commented Dec 19, 2025

Description

Add support for StacTooltipThemeData in Stac.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

Summary by CodeRabbit

  • New Features
    • Tooltip theming is now supported, allowing customization of appearance, sizing, spacing, durations, alignment and trigger modes.
    • Theme-level tooltip settings are exposed and applied at runtime via the app theme.
    • Tooltip theme objects are serializable to/from JSON, enabling persistence and configuration sharing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
Core model & serialization
packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.dart, packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.g.dart
New StacTooltipThemeData class with fields mirroring Flutter's TooltipThemeData, JsonSerializable-generated from/to JSON and enum mappings.
StacTheme integration
packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.dart, packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.g.dart
Adds nullable tooltipTheme field/constructor parameter to StacTheme; updates JSON (de)serialization to include tooltipTheme.
Parser implementation
packages/stac/lib/src/parsers/theme/stac_tool_tip_theme_data_parser.dart, packages/stac/lib/src/parsers/theme/stac_theme_parser.dart
New extension StacTooltipThemeData.parse(BuildContext) converting model → TooltipThemeData; main theme parser now invokes tooltipTheme?.parse(context).
Public exports
packages/stac_core/lib/foundation/theme/theme.dart, packages/stac/lib/src/parsers/theme/themes.dart
Exported stac_tool_tip_theme_data.dart and its parser from public theme export files.

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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to nested-field parser delegation (constraints, padding, decoration, textStyle, durations, enums).
  • Verify null-safety and correct enum string mappings in generated code.
  • Confirm exports and imports are consistent across packages.

Possibly related PRs

Suggested reviewers

  • divyanshub024
  • Potatomonsta

Poem

🐰 I nibble at JSON, hop through code bright,
Fields map to Flutter, everything fits right,
From Stac to Tooltip I parse with a grin,
ThemeData gets fluff — let the hover begin! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: introducing StacTooltipThemeData and its parser across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a40e030 and 5acdc56.

📒 Files selected for processing (2)
  • 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)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.dart
  • packages/stac_core/lib/foundation/theme/stac_tool_tip_theme_data/stac_tool_tip_theme_data.g.dart
⏰ 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)
  • GitHub Check: pub_get_check

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc7a5e5 and a40e030.

📒 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 StacTooltipThemeData and 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 tooltipTheme field.

Also applies to: 129-129

packages/stac_core/lib/foundation/theme/stac_theme/stac_theme.dart (1)

31-31: LGTM!

The tooltipTheme field is properly integrated into StacTheme with 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 StacTooltipThemeData model is well-structured with comprehensive field coverage for Flutter's TooltipThemeData. 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 tooltipTheme field 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 calling fromJson() 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 (StacTextAlign and StacTooltipTriggerMode at 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

@akhil-ge0rge
Copy link
Contributor Author

Hi @divyanshub024 , @Potatomonsta 👋,
Please take a look. Thanks!

Copy link
Member

@divyanshub024 divyanshub024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again, thank you for your amazing contribution 🎉 💯

@divyanshub024 divyanshub024 merged commit 3807182 into StacDev:dev Dec 19, 2025
7 of 8 checks passed
@akhil-ge0rge
Copy link
Contributor Author

Once again, thank you for your amazing contribution 🎉 💯

Thank you! I’m glad to have been able to contribute.

@akhil-ge0rge akhil-ge0rge deleted the feat-tool-tip-theme branch December 29, 2025 08:00
lstonussi pushed a commit to SuaMusica/stac that referenced this pull request Feb 25, 2026
* feat: Introduce StacTooltipThemeData and parser

* fix: remove unused deprecated height from StacTooltipThemeData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants