Skip to content

Conversation

@divyanshub024
Copy link
Member

@divyanshub024 divyanshub024 commented Jan 29, 2026

Description

Enhance the Positioned widget with new constructors

  • Clarify the functionality of the Stac Positioned widget and its relation to Flutter's Positioned widget.
  • Add detailed explanations of positioning constraints and properties, including nullability.
  • Introduce new named constructors: fromRect and fromRelativeRect, with usage examples.
  • Update onboarding screen example to utilize StacPositioned.fill for better layout management.
  • Change import from 'flutter/cupertino.dart' to 'flutter/material.dart' in the positioned parser for consistency.

Related Issues

Closes #

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 four new constructors to Positioned: fill() for full stack coverage, fromRect() for rect-based positioning, fromRelativeRect() for relative offsets, and directional() for text-direction-aware layouts.
  • Documentation

    • Enhanced Positioned widget documentation with positioning constraint rules and comprehensive constructor descriptions.

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

@divyanshub024 divyanshub024 marked this pull request as ready for review January 29, 2026 13:23
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This PR introduces four new convenience constructors to the StacPositioned widget (fromRect, fromRelativeRect, fill, directional), expands documentation to clarify positioning constraints, updates an example to use the new fill constructor, and changes a library import from cupertino to material.

Changes

Cohort / File(s) Summary
Documentation Overhaul
docs/widgets/positioned.mdx
Comprehensively rewrote Positioned documentation with expanded descriptions, new positioning constraints section, optional property markers, and documented all four new Dart-only constructors with examples.
Core Constructor Additions
packages/stac_core/lib/widgets/positioned/stac_positioned.dart
Added four public constructors/factories: fromRect() mapping rect properties, fromRelativeRect() with explicit edge values, fill() with 0.0 defaults for full coverage, and directional() computing left/right from text direction.
Example Modernization
examples/movie_app/stac/onboarding_screen.dart
Refactored explicit positioning (left: 0, right: 0, bottom: 0) to use the new StacPositioned.fill() constructor.
Library Import Update
packages/stac/lib/src/parsers/widgets/stac_positioned/stac_positioned_parser.dart
Changed import from Flutter cupertino to material library for widget theming context.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Four paths now pave the way to stack,
Fill and rect, directional and back—
Where bunnies hop with width and height,
Positioned widgets, oh what a delight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding new constructors (fromRect, fromRelativeRect, fill, directional) to the StacPositioned widget, which is the primary code contribution alongside documentation updates.
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.

@divyanshub024 divyanshub024 merged commit 7efb88f into dev Jan 29, 2026
6 checks passed
@divyanshub024 divyanshub024 deleted the dv/update-positioned branch January 29, 2026 19:35
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.

2 participants