Skip to content

Comments

feat: add stacSliverVisibility widget, parser,example and documentation #426

Merged
divyanshub024 merged 4 commits intoStacDev:devfrom
akhil-ge0rge:feat-sliver-visibility
Jan 27, 2026
Merged

feat: add stacSliverVisibility widget, parser,example and documentation #426
divyanshub024 merged 4 commits intoStacDev:devfrom
akhil-ge0rge:feat-sliver-visibility

Conversation

@akhil-ge0rge
Copy link
Contributor

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

Description

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

Related Issues

Closes #418

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 SliverVisibility widget support for conditional sliver visibility with optional replacement and maintain flags
  • Examples

    • Added an interactive gallery example showcasing SliverVisibility usage and behavior
  • Documentation

    • Added a documentation page describing SliverVisibility properties, behavior, and usage examples

✏️ 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 SliverVisibility support to STAC: new core model and JSON (de)serialization, parser and parser registration, docs and example assets, and exports to expose the new widget type.

Changes

Cohort / File(s) Summary
Documentation
docs/docs.json, docs/widgets/sliver_visibility.mdx
Added navigation entry and new docs page describing SliverVisibility, properties, example, and link to Flutter docs.
Example Gallery
examples/stac_gallery/assets/json/home_screen.json, examples/stac_gallery/assets/json/sliver_visibility_example.json
Added gallery list tile and a new example JSON demonstrating a SliverVisibility usage.
Core Widget Model
packages/stac_core/lib/foundation/specifications/widget_type.dart, packages/stac_core/lib/widgets/sliver_visibility/stac_sliver_visibility.dart, packages/stac_core/lib/widgets/sliver_visibility/stac_sliver_visibility.g.dart, packages/stac_core/lib/widgets/widgets.dart
Added sliverVisibility enum value; implemented StacSliverVisibility model with fields (sliver, replacementSliver, visible, maintain* flags); added generated JSON (de)serialization and exported the model.
Parser Implementation
packages/stac/lib/src/parsers/widgets/stac_sliver_visibility/stac_sliver_visibility_parser.dart, packages/stac/lib/src/parsers/widgets/widgets.dart, packages/stac/lib/src/framework/stac_service.dart
Added StacSliverVisibilityParser, exported it from parsers barrel, and registered the parser in StacService parser list so STAC can parse and build SliverVisibility widgets.

Sequence Diagram(s)

sequenceDiagram
  participant Service as StacService
  participant Parser as StacSliverVisibilityParser
  participant Model as StacSliverVisibility
  participant Builder as FlutterWidgetBuilder

  Service->>Parser: request parser for type "sliverVisibility"
  Parser->>Model: fromJson(json)
  Parser->>Parser: parse nested `sliver` / `replacementSliver` via context
  Parser->>Builder: construct SliverVisibility(sliver, replacementSliver, flags)
  Builder->>Flutter: insert SliverVisibility into widget tree
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • divyanshub024
  • Potatomonsta

Poem

🐰 I hopped through JSON, parser, and doc,
I stitched a sliver from code to the block,
Now visible, hidden, or standing in place,
STAC's got a sliver with elegance and grace 🥕✨

🚥 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 new StacSliverVisibility widget with parser, example, and documentation.
Linked Issues check ✅ Passed The PR fully implements the requirement from issue #418 to create StacSliverVisibility as a StacWidget implementation of Flutter's SliverVisibility.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing StacSliverVisibility and its supporting infrastructure; no unrelated modifications detected.
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.

@akhil-ge0rge
Copy link
Contributor Author

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

@divyanshub024
Copy link
Member

@akhil-ge0rge Let's merge this one as well!!

@akhil-ge0rge
Copy link
Contributor Author

@akhil-ge0rge Let's merge this one as well!!

@divyanshub024 Done

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.

Thanks a lot for the contribution. Really appreciate the effort 🙌🔥

@divyanshub024 divyanshub024 merged commit feb41a4 into StacDev:dev Jan 27, 2026
5 checks passed
@akhil-ge0rge
Copy link
Contributor Author

Thanks a lot for the contribution. Really appreciate the effort 🙌🔥

Thanks a lot! Happy to contribute and really appreciate the support 🙌

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 SliverVisibility

2 participants