-
-
Notifications
You must be signed in to change notification settings - Fork 89
feat: add stacSliverPadding widget, parser,example and documentation #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a new StacSliverPadding model, JSON (de)serialization, parser, parser registration and export, WidgetType enum entry, documentation page, and an example + gallery navigation entry for SliverPadding. 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
Parser->>Flutter: parse(context, model) -> SliverPadding widget
Flutter->>Flutter: render inside CustomScrollView
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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.
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 `@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 👋, |
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.