{"id":21748284,"url":"https://github.com/surfstudio/flutter-render-metrics","last_synced_at":"2025-07-04T06:36:58.348Z","repository":{"id":40244579,"uuid":"384333318","full_name":"surfstudio/flutter-render-metrics","owner":"surfstudio","description":"Made by Surf 🏄","archived":false,"fork":false,"pushed_at":"2024-06-24T15:22:49.000Z","size":571,"stargazers_count":20,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-13T07:13:18.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surfstudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-07-09T05:40:40.000Z","updated_at":"2024-12-18T18:43:25.000Z","dependencies_parsed_at":"2024-04-12T09:08:04.393Z","dependency_job_id":null,"html_url":"https://github.com/surfstudio/flutter-render-metrics","commit_stats":{"total_commits":19,"total_committers":8,"mean_commits":2.375,"dds":0.7894736842105263,"last_synced_commit":"5c03d009b9641385794986681836a5518ccecad8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2Fflutter-render-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2Fflutter-render-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2Fflutter-render-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surfstudio%2Fflutter-render-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surfstudio","download_url":"https://codeload.github.com/surfstudio/flutter-render-metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675422,"owners_count":21143768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T08:12:55.302Z","updated_at":"2025-04-13T07:13:23.597Z","avatar_url":"https://github.com/surfstudio.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Render Metrics\n\n\u003cimg src=\"https://raw.githubusercontent.com/surfstudio/flutter-open-source/main/assets/logo_black.png#gh-light-mode-only\" width=\"200\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/surfstudio/flutter-open-source/main/assets/logo_white.png#gh-dark-mode-only\" width=\"200\"\u003e\n\nMade by [Surf 🏄‍♂️🏄‍♂️🏄‍♂️](https://surf.dev/)\n\n[![Build Status](https://shields.io/github/actions/workflow/status/surfstudio/flutter-render-metrics/main.yml?logo=github\u0026logoColor=white)](https://github.com/surfstudio/flutter-render-metrics)\n[![Coverage Status](https://img.shields.io/codecov/c/github/surfstudio/flutter-render-metrics?=render_metrics\u0026logo=codecov\u0026logoColor=white)](https://app.codecov.io/gh/surfstudio/flutter-render-metrics)\n[![Pub Version](https://img.shields.io/pub/v/render_metrics?logo=dart\u0026logoColor=white)](https://pub.dev/packages/render_metrics)\n[![Pub Likes](https://badgen.net/pub/likes/render_metrics)](https://pub.dev/packages/render_metrics)\n[![Pub popularity](https://badgen.net/pub/popularity/render_metrics)](https://pub.dev/packages/render_metrics/score)\n![Flutter Platform](https://badgen.net/pub/flutter-platform/render_metrics)\n\n## Overview\n\nThis package helps retrieve the current positioning coordinates of any widget in a widgets tree in your Flutter application.\n\n## Currently supported features\n\n- Retrieve the full set of positioning coordinates of the desired widget at any time;\n- Calculate the difference in positioning between two widgets and use it the way you need.\n\n## Example\n\n### Getting widget's coordinates\n\nInstantiate `RenderParametersManager` object. You can set a special type for the widget's unique identifier or leave it `dynamic`.\n\n```dart\nfinal renderManager = RenderParametersManager\u003cdynamic\u003e();\n```\n\nWrap the desired widget in a `RenderMetricsObject`. The `id` parameter is the widget’s unique identifier.\n\n```dart\nRenderMetricsObject(\n    id: \"uniqueWidgetId\",\n    manager: renderManager,\n    child: Container(\n        ...\n    ),\n),\n```\n\nGet a bundle with the positioning coordinates of the wrapped widget.\n\n```dart\nRenderData data = renderManager.getRenderData(\"uniqueWidgetId\");\n```\n\n### Calculating the difference in positioning between two widgets\n\nWrap the widgets you want to compare in `RenderMetricsObject`s. Specify two different `id`s for each of them. Please note, that the `manager` parameter of both widgets should contain the link to the same `RenderParametersManager` instance.\n\n```dart\nRenderMetricsObject(\n    id: \"rowWidgetId\",\n    manager: renderManager,\n    child: Row(\n        ...\n    ),\n),\nRenderMetricsObject(\n    id: \"columnWidgetId\",\n    manager: renderManager,\n    child: Column(\n        ...\n    ),\n),\n```\n\nSpecify two unique widget identifiers when using the `getDiffById()` function and extract a bundle with the relative difference in positioning coordinates between the widgets.\n\n```dart\nComparisonDiff diff =\n    renderManager.getDiffById(\"rowWidgetId\", \"columnWidgetId\");\n```\n\n## What metrics can I get?\n\n### RenderData\n\n`RenderData` instance contains a complete set of properties that characterize any widget in a two-dimensional space.\n\nAll metrics positioning coordinates are global, meaning they are relative to the entire screen coordinate space.\n\n![RenderData](https://i.ibb.co/CzCWkSB/render-data-1.png)\n\n`RenderData` also provides you an ability to get all widget keypoint XY-coordinates by calling one of special getters.\n\n![RenderData](https://i.ibb.co/DQzt33H/render-data-2.png)\n\n### ComparisonDiff\n\nYou can get the comparison relative results for each widget keypoint from the `ComparisonDiff` instance.\n\nAn additional set of special getters can help you calculate the difference between two adjacent sides of two different widgets (e.g. right to left, top to bottom, etc.).\n\n![RenderData](https://i.ibb.co/SNMPztt/render-diff.png)\n\n## Installation\n\nAdd `render_metrics` to your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  render_metrics: $currentVersion$\n```\n\n\u003cp\u003eAt this moment, the current version of \u003ccode\u003erender_metrics\u003c/code\u003e is \u003ca href=\"https://pub.dev/packages/render_metrics\"\u003e\u003cimg style=\"vertical-align:middle;\" src=\"https://img.shields.io/pub/v/render_metrics.svg\" alt=\"render_metrics version\"\u003e\u003c/a\u003e.\u003c/p\u003e\n\n## Changelog\n\nAll notable changes to this project will be documented in [this file](./CHANGELOG.md).\n\n## Issues\n\nTo report your issues, submit them directly in the [Issues](https://github.com/surfstudio/flutter-render-metrics/issues) section.\n\n## Contribute\n\nIf you would like to contribute to the package (e.g. by improving the documentation, fixing a bug or adding a cool new feature), please read our [contribution guide](./CONTRIBUTING.md) first and send us your pull request.\n\nYour PRs are always welcome.\n\n## How to reach us\n\nPlease feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.\n\n[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-blue.svg)](https://t.me/SurfGear)\n\n## License\n\n[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurfstudio%2Fflutter-render-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurfstudio%2Fflutter-render-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurfstudio%2Fflutter-render-metrics/lists"}