feat: add stacSliverPadding widget, parser,example and documentation#421
feat: add stacSliverPadding widget, parser,example and documentation#421divyanshub024 merged 9 commits intoStacDev:devfrom
Conversation
📝 WalkthroughWalkthroughAdds StacSliverPadding end-to-end: new core model and JSON (de)serializers, WidgetType enum entry, parser and registration/export, documentation and gallery example plus home-screen entry enabling JSON-driven SliverPadding usage. Changes
Sequence Diagram(s)sequenceDiagram
participant JSON as JSON asset
participant Service as StacService
participant Parser as StacSliverPaddingParser
participant Model as StacSliverPadding
participant Flutter as Flutter SliverPadding
JSON->>Service: load JSON
Service->>Parser: dispatch by type "sliverPadding"
Parser->>Model: getModel(json)
Parser->>Parser: construct StacSliverPadding (padding, sliver)
Parser->>Flutter: parse(context, model) -> SliverPadding widget
Flutter->>Flutter: render inside CustomScrollView
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@examples/stac_gallery/assets/json/home_screen.json`:
- Around line 1250-1253: Update the "subtitle" value in the JSON entry for the
SliverPadding tile (the "subtitle" property) to remove the incorrect "Material
Design" qualifier; replace "A Material Design Sliver Padding widget" with a
concise, accurate phrase such as "A Flutter SliverPadding widget" or "A
SliverPadding widget" so it correctly reflects that SliverPadding is from
Flutter's widgets library.
In `@packages/stac_core/lib/widgets/sliver_padding/stac_sliver_padding.dart`:
- Around line 22-48: The JSON example in the documentation block of
stac_sliver_padding.dart uses // single-line comments so it won't be picked up
by doc generation; update the JSON lines inside the fenced comment (the block
between ```json and ```) to use Dart doc comment markers (///) instead of // so
the example is included in generated docs — i.e., replace each leading // with
/// for the JSON object lines in the sliverPadding example.
🧹 Nitpick comments (1)
packages/stac/lib/src/parsers/widgets/stac_sliver_padding/stac_sliver_padding_parser.dart (1)
4-4: Unused import.The
stac_edge_insets_parser.dartimport appears unused. Themodel.padding.parsegetter is provided byStacEdgeInsets(fromstac_core), not by the parser.🔧 Suggested fix
import 'package:flutter/material.dart'; import 'package:stac/src/parsers/core/stac_widget_parser.dart'; - -import 'package:stac/src/parsers/foundation/geometry/stac_edge_insets_parser.dart'; import 'package:stac_core/stac_core.dart'; import 'package:stac_framework/stac_framework.dart';
|
Hi @divyanshub024 , @Potatomonsta 👋, |
|
@akhil-ge0rge Your PR example is failing. Can you please check? |
Hi @divyanshub024 , all checks are passing on my side. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/stac_core/lib/widgets/sliver_padding/stac_sliver_padding.dart`:
- Around line 51-72: The StacSliverPadding class lacks explicit nested JSON
serialization; update the class annotation to `@JsonSerializable`(explicitToJson:
true) on the StacSliverPadding declaration so its nested fields (padding:
StacEdgeInsets and sliver: StacWidget) are serialized consistently with other
widgets (e.g., StacCustomScrollView, StacGestureDetector); ensure the generator
is re-run so _$StacSliverPaddingFromJson and _$StacSliverPaddingToJson handle
nested toJson calls.
|
@akhil-ge0rge, can you please resolve the conflicts? |
@divyanshub024 Done |
packages/stac_core/lib/widgets/sliver_padding/stac_sliver_padding.dart
Outdated
Show resolved
Hide resolved
divyanshub024
left a comment
There was a problem hiding this comment.
Great work @akhil-ge0rge 💯 🚀
Description
This PR introduces support for stacSliverPadding by adding a new widget model and its corresponding parser.
Related Issues
Closes #417
Type of Change
Summary by CodeRabbit
New Features
Documentation
Examples
✏️ Tip: You can customize this high-level summary in your review settings.