Skip to content

Conversation

@akhil-ge0rge
Copy link
Contributor

@akhil-ge0rge akhil-ge0rge commented Jan 17, 2026

Description

This PR introduces support for stacSliverOpacity by adding a new widget model and its corresponding parser.

Related Issues

Closes #419

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

    • Added support for SliverOpacity widget with full framework integration and configuration options.
  • Documentation

    • Added comprehensive documentation for the new SliverOpacity widget, including properties and usage details.
  • Examples

    • Added gallery example demonstrating SliverOpacity usage with sample code and visual reference.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

📝 Walkthrough

Walkthrough

This PR introduces support for the SliverOpacity widget to the Stac framework by adding a new StacSliverOpacity model class, its corresponding parser, registering it in the framework's service layer, extending the WidgetType enum, and providing documentation and gallery examples.

Changes

Cohort / File(s) Summary
Core Model & JSON Serialization
packages/stac_core/lib/widgets/sliver_opacity/stac_sliver_opacity.dart, packages/stac_core/lib/widgets/sliver_opacity/stac_sliver_opacity.g.dart
Introduces JsonSerializable StacSliverOpacity class with required opacity field (0.0–1.0), optional alwaysIncludeSemantics and sliver fields, and generated (de)serialization methods.
Parser Implementation
packages/stac/lib/src/parsers/widgets/stac_sliver_opacity/stac_sliver_opacity_parser.dart
Implements StacSliverOpacityParser to convert StacSliverOpacity models into Flutter SliverOpacity widgets, mapping opacity and nested sliver properties.
Parser Registration & Exports
packages/stac/lib/src/framework/stac_service.dart, packages/stac/lib/src/parsers/widgets/widgets.dart, packages/stac_core/lib/widgets/widgets.dart
Registers the new parser in StacService and adds public exports in barrel files for accessible imports.
Type System Extension
packages/stac_core/lib/foundation/specifications/widget_type.dart
Adds sliverOpacity enum value to WidgetType to support type identification and routing for SliverOpacity widgets.
Documentation & Examples
docs/docs.json, docs/widgets/sliver_opacity.mdx, examples/stac_gallery/assets/json/home_screen.json, examples/stac_gallery/assets/json/sliver_opacity_example.json
Adds widget documentation, properties reference, gallery entry, and interactive JSON example demonstrating SliverOpacity with a faded container inside.

Sequence Diagram(s)

sequenceDiagram
    participant App as App/Client
    participant Framework as Stac Framework
    participant Parser as SliverOpacityParser
    participant Flutter as Flutter Engine

    App->>Framework: Load JSON with SliverOpacity
    Framework->>Parser: Identify type: sliverOpacity
    Parser->>Parser: Extract opacity, alwaysIncludeSemantics, sliver
    Parser->>Parser: Parse nested sliver widget
    Parser->>Flutter: Build SliverOpacity widget
    Flutter->>Flutter: Render faded sliver content
    Flutter->>App: Display on screen
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • divyanshub024
  • Potatomonsta

Poem

🐰 A sliver so pale, now fades with such grace,
Through JSON to Parser, then its rightful place,
Opacity whispers where slivers once gleamed,
The SliverOpacity widget fulfills every dream!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a SliverOpacity widget with parser, example, and documentation.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #419: creates StacSliverOpacity class with proper model, parser integration, and type enum support.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing SliverOpacity support; documentation, examples, and exports are appropriate supporting additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

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.

feat: create StacWidget implementation of SliverOpacity

1 participant