Skip to content

feat: add constructors for StacImage widget to support asset, network and file sources#439

Merged
divyanshub024 merged 3 commits intodevfrom
dv/stac-image-contructors
Jan 30, 2026
Merged

feat: add constructors for StacImage widget to support asset, network and file sources#439
divyanshub024 merged 3 commits intodevfrom
dv/stac-image-contructors

Conversation

@divyanshub024
Copy link
Member

@divyanshub024 divyanshub024 commented Jan 30, 2026

Description

feat: add constructors for StacImage widget to support asset, network and file sources

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)
  • [ x Code refactor
  • Build configuration change
  • Documentation
  • Chore

Summary by CodeRabbit

  • New Features
    • StacImage now supports three simple ways to load images from asset, network, or file sources, making initialization easier across common use cases. Each option supports standard display controls (alignment, color, size, fit, repeat, filter quality) and accessibility settings for improved rendering and semantics.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Adds three named constructors to StacImage: asset, network, and file, each taking a source (path or URL) plus common display options and setting src and imageType accordingly.

Changes

Cohort / File(s) Summary
StacImage Convenience Constructors
packages/stac_core/lib/widgets/image/stac_image.dart
Added const StacImage.asset(String path, { ... }), const StacImage.network(String url, { ... }), and const StacImage.file(String path, { ... }). Each initializes src and imageType to the corresponding StacImageType and accepts alignment, color, width, height, fit, repeat, filterQuality, semanticLabel, and excludeFromSemantics.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 New paths and links for pictures to show,
Asset, network, file—three ways to go.
I hop with delight, constructors in hand,
StacImage now greets every image and land. 🥕

🚥 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 describes the main change: adding three constructors to StacImage widget for asset, network, and file sources.
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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dv/stac-image-contructors

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


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.

…ageType` enum with constructor-specific examples for asset, network, and file images.
@divyanshub024 divyanshub024 merged commit 5fc7741 into dev Jan 30, 2026
5 checks passed
@divyanshub024 divyanshub024 deleted the dv/stac-image-contructors branch January 30, 2026 15:40
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.

1 participant