Skip to content

Conversation

@akhil-ge0rge
Copy link
Contributor

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

Description

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

Related Issues

Closes #422

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 SliverToBoxAdapter widget to support embedding box widgets inside sliver-based layouts.
  • Documentation

    • Added a new docs page detailing properties, usage patterns, and examples.
  • Examples

    • Added an interactive gallery entry and a runnable example demonstrating SliverToBoxAdapter usage.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

📝 Walkthrough

Walkthrough

Adds first-class support for SliverToBoxAdapter: a StacSliverToBoxAdapter model with JSON (de)serialization, a parser that renders a Flutter SliverToBoxAdapter, registration of the parser in the framework, WidgetType enum variant, exports, docs, and example gallery assets.

Changes

Cohort / File(s) Summary
Documentation
docs/docs.json, docs/widgets/sliver_to_box_adapter.mdx
New docs entry and page for SliverToBoxAdapter under Widgets → Layout Widgets; includes props table and example JSON.
Example Assets
examples/stac_gallery/assets/json/home_screen.json, examples/stac_gallery/assets/json/sliver_to_box_adapter_example.json
Added gallery menu item and example JSON demonstrating a CustomScrollView → SliverPadding → SliverToBoxAdapter with a centered container.
Core Model
packages/stac_core/lib/widgets/sliver_to_box_adapter/stac_sliver_to_box_adapter.dart, packages/stac_core/lib/widgets/sliver_to_box_adapter/stac_sliver_to_box_adapter.g.dart
New StacSliverToBoxAdapter JsonSerializable model with optional child and generated (de)serializers. Review JSON shape and generated code.
Widget Type & Exports
packages/stac_core/lib/foundation/specifications/widget_type.dart, packages/stac_core/lib/widgets/widgets.dart
Added sliverToBoxAdapter enum value and exported the new model from the widgets barrel.
Parser Implementation & Exports
packages/stac/lib/src/parsers/widgets/stac_sliver_to_box_adapter/stac_sliver_to_box_adapter_parser.dart, packages/stac/lib/src/parsers/widgets/widgets.dart
New StacSliverToBoxAdapterParser mapping JSON→model→SliverToBoxAdapter widget; exported from parsers barrel. Check parser type string matches enum-derived name.
Framework Registration
packages/stac/lib/src/framework/stac_service.dart
Registered StacSliverToBoxAdapterParser in the service's parsers list.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • divyanshub024
  • Potatomonsta

Poem

🐰 A sliver cradles a tiny box so snug,
JSON whispers, the parser gives a hug,
Model and docs hop in, all set to play,
From text to widget — a bright new display! ✨

🚥 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 describes the main changes: addition of stacSliverToBoxAdapter widget, parser, example, and documentation.
Linked Issues check ✅ Passed The PR successfully implements StacSliverToBoxAdapter as a StacWidget, fulfilling the core requirement of issue #422.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing SliverToBoxAdapter support: widget model, parser, type registration, exports, documentation, and example.
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.

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: 2

🤖 Fix all issues with AI agents
In `@docs/widgets/sliver_to_box_adapter.mdx`:
- Around line 6-8: Update the prose describing the widget to hyphenate the
compound adjective: replace occurrences of "sliver to box adapter" with
"sliver-to-box-adapter" in the sentence that mentions "The Stac
SliverToBoxAdapter allows you to build a Flutter sliver to box adapter widget
using JSON." Ensure the phrase "sliver-to-box-adapter widget" appears
consistently (e.g., in the line referencing the official documentation) and keep
the class name "SliverToBoxAdapter" unchanged.

In `@packages/stac_core/lib/foundation/specifications/widget_type.dart`:
- Around line 210-211: The doc comment for the enum value sliverToBoxAdapter is
incorrect (it says "Sliver app bar widget"); update the comment above the
sliverToBoxAdapter enum member in widget_type.dart to accurately describe that
it represents a SliverToBoxAdapter widget (e.g., "SliverToBoxAdapter widget" or
similar). Ensure the updated comment is concise and matches the naming/style of
other enum docs in the same file.

@akhil-ge0rge
Copy link
Contributor Author

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

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 SliverToBoxAdapter

1 participant