Skip to content

Conversation

@akhil-ge0rge
Copy link
Contributor

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

Description

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

Related Issues

Closes #420

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 SliverSafeArea widget support for sliver-based layouts (configurable insets).
  • Documentation

    • New SliverSafeArea doc page with properties, examples, and links to official docs.
  • Examples

    • New gallery entry and example demonstrating SliverSafeArea 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

This PR adds a StacSliverSafeArea widget: model, JSON (de)serialization, parser, widget-type registration, documentation, and a gallery example; it also registers the parser in StacService and exports the parser and widget from their barrels.

Changes

Cohort / File(s) Summary
Core Widget Model
packages/stac_core/lib/widgets/sliver_safe_area/stac_sliver_safe_area.dart, packages/stac_core/lib/widgets/sliver_safe_area/stac_sliver_safe_area.g.dart, packages/stac_core/lib/widgets/widgets.dart, packages/stac_core/lib/foundation/specifications/widget_type.dart
Added StacSliverSafeArea model with fields (left, top, right, bottom, minimum, sliver), JSON (de)serialization, exported from widgets barrel, and added sliverSafeArea to WidgetType enum.
Parser Implementation & Registration
packages/stac/lib/src/parsers/widgets/stac_sliver_safe_area/stac_sliver_safe_area_parser.dart, packages/stac/lib/src/parsers/widgets/widgets.dart, packages/stac/lib/src/framework/stac_service.dart
Added StacSliverSafeAreaParser (null-tolerant defaults; fallback inner sliver), exported parser in parsers barrel (duplicate export present), and registered parser in StacService parser list.
Documentation
docs/docs.json, docs/widgets/sliver_safe_area.mdx
Added docs entry under Widgets → Interactive Widgets and new MDX page describing SliverSafeArea with properties and example.
Gallery Examples
examples/stac_gallery/assets/json/home_screen.json, examples/stac_gallery/assets/json/sliver_safe_area_example.json
Added gallery list item and JSON example demonstrating a sliverSafeArea wrapping a sliverToBoxAdapter with text content.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested labels

feature

Suggested reviewers

  • divyanshub024
  • Potatomonsta

Poem

🐰 A safe area for slivers, snug and neat,
Padding the edges where scrolls and slivers meet.
A tiny parser hops in to play,
Turning JSON to widgets along the way.
Hooray for safe scrolls — a rabbit's little treat!

🚥 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 clearly and accurately describes the main change: adding a StacSliverSafeArea widget along with its parser, example, and documentation.
Linked Issues check ✅ Passed The PR implements StacSliverSafeArea [#420], the core requirement, with widget model, parser, documentation, and examples.
Out of Scope Changes check ✅ Passed All changes directly relate to adding SliverSafeArea support: widget model, parser, documentation, examples, and integration into the framework.
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: 1

🤖 Fix all issues with AI agents
In
`@packages/stac/lib/src/parsers/widgets/stac_sliver_safe_area/stac_sliver_safe_area_parser.dart`:
- Line 19: The current fallback for model.sliver.parse(context) uses
SizedBox.shrink() which is not a sliver and will crash SliverSafeArea; either
remove the fallback (since model.sliver is non-nullable) or replace it with a
sliver-compatible fallback such as wrapping the box in a SliverToBoxAdapter;
update the expression using model.sliver.parse(context) and ensure
SliverSafeArea receives a RenderSliver-compatible child (refer to the sliver
variable and the SliverSafeArea usage).

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 SliverSafeArea

1 participant