zeba_academy_measure 0.0.1 copy "zeba_academy_measure: ^0.0.1" to clipboard
zeba_academy_measure: ^0.0.1 copied to clipboard

Lightweight Flutter utility to measure widget size, position, and listen to layout changes using GlobalKey helpers.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/) and this project follows Semantic Versioning.


0.0.1 - 2026-07-06 #

๐ŸŽ‰ Initial Release #

This is the first release of zeba_academy_measure.

โœจ Added #

  • ๐Ÿ“ Measure widget size using GlobalKey
  • ๐Ÿ“ Get widget global position on screen
  • ๐Ÿ”‘ GlobalKey extension helpers:
    • key.size โ†’ returns widget size
    • key.position โ†’ returns global offset position
    • key.metrics โ†’ returns combined WidgetMetrics
  • ๐Ÿงฉ MeasureController for manual measurement trigger with callback support
  • ๐Ÿ“ฆ MeasureWidget for automatic size and position tracking
  • ๐Ÿ”„ SizeChangeListener for detecting layout size changes in real time
  • โšก Post-frame safe measurement using WidgetsBinding.instance.addPostFrameCallback

๐Ÿง  Technical Details #

  • Uses RenderBox for accurate layout measurement
  • Uses LayoutBuilder for constraint-based size detection
  • Uses GlobalKey extensions for simplified API
  • Safe post-frame execution to avoid build-time errors

โš ๏ธ Notes #

  • Measurements are only available after the first frame is rendered
  • Best used with constrained widgets (e.g., SizedBox, Container with fixed size)
  • Avoid using inside unbounded layouts for accurate results

๐Ÿงช Testing #

  • Added widget test support for WidgetMetrics
  • Added basic integration test for GlobalKey measurement accuracy

[Unreleased] #

๐Ÿšง Planned #

  • ๐Ÿ”ฅ Stream-based live measurement updates
  • ๐Ÿ”ฅ Visibility detection (in-view tracking)
  • ๐Ÿ”ฅ Scroll-aware measurement system
  • ๐Ÿ”ฅ Riverpod integration support
  • ๐Ÿ”ฅ Animation triggers on size change
  • ๐Ÿ”ฅ Performance optimizations for frequent layout changes

๐Ÿ“Œ Versioning Strategy #

  • Patch versions (0.0.x): Bug fixes and minor improvements
  • Minor versions (0.x.0): New features, backward compatible
  • Major versions (x.0.0): Breaking changes

๐Ÿ‘จโ€๐Ÿ’ป Maintainer #

Sufyan bin Uzayr
Open-source developer building developer tools and learning platforms.

๐ŸŒ https://zeba.academy
๐Ÿ“š https://code.zeba.academy
๐Ÿ’ผ https://www.linkedin.com/in/sufyanism
๐Ÿ“บ https://www.youtube.com/@zeba.academy


๐Ÿ“„ License #

Licensed under GNU General Public License v3.0 (GPL-3.0)

0
likes
140
points
69
downloads

Documentation

API reference

Publisher

verified publisherzeba.academy

Weekly Downloads

Lightweight Flutter utility to measure widget size, position, and listen to layout changes using GlobalKey helpers.

Homepage

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on zeba_academy_measure