widget मेट्रिक प्राप्त करने के लिए पुस्तकालय। RenderObject का उपयोग करके स्क्रीन विंडो के संदर्भ में widget के आकार और स्थिति, साथ ही widget के बीच के अंतर को प्राप्त करता है।
सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
render_metrics पैकेज फ्लटर एप्लिकेशन में विजेट्स के लिए सटीक लेआउट मेट्रिक्स प्राप्त करने का एक तरीका प्रदान करता है। RenderObject का उपयोग करके, यह डेवलपर्स को विजेट्स के लिए सटीक आकार और स्क्रीन स्थिति डेटा प्राप्त करने की अनुमति देता है, साथ ही विजेट स्थितियों के बीच अंतर को मापने में सक्षम बनाता है। यह लेआउट समस्याओं के निदान, कस्टम एनीमेशन के कार्यान्वयन, या विशिष्ट UI घटकों के साथ संरेखित ओवरले तत्व बनाने के लिए विशेष रूप से उपयोगी है। लाइब्रेरी सभी प्रमुख प्लेटफॉर्म के लिए समर्थन प्रदान करती है, जिनमें एंड्रॉइड, आईओएस, वेब, मैकओएस, विंडोज और लिनक्स शामिल हैं।
उपयोग
डिबगिंग विजेट स्थिति
डायनामिक ओवरले बनाना
बिन्यास परिवर्तनों का मापन
कस्टम एनिमेशन कार्यान्वयन
UI प्रदर्शन का विश्लेषण करना
मुख्य विशेषताएँ
विजेट के आकार और स्क्रीन स्थिति तक पहुँच
समय के साथ विजेट मेट्रिक्स की तुलना
क्रॉस-प्लेटफॉर्म संगतता
RenderObject के साथ एकीकरण
हल्का और एकाग्र API
इनके लिए उपयुक्त
UI डिबगिंग टूल्स
कस्टम लेआउट उपकरण
एनिमेशन फ्रेमवर्क
डेवलपर टूलिंग
प्रदर्शन विश्लेषण
विचार योग्य बातें
RenderObject संदर्भ के एक्सेस की आवश्यकता है
अत्यधिक उपयोग करने पर प्रदर्शन प्रभावित हो सकता है
उच्च आवृत्ति परिदृश्यों में रनटाइम मीट्रिक्स के लिए उपयुक्त नहीं
रेंडरिंग के दौरान सीमित दृश्य विजेट्स
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Get a bundle with the positioning coordinates of the wrapped widget.
RenderData data = renderManager.getRenderData("uniqueWidgetId");
Calculating the difference in positioning between two widgets
Wrap the widgets you want to compare in RenderMetricsObjects. Specify two different ids for each of them. Please note, that the manager parameter of both widgets should contain the link to the same RenderParametersManager instance.
Specify two unique widget identifiers when using the getDiffById() function and extract a bundle with the relative difference in positioning coordinates between the widgets.
RenderData instance contains a complete set of properties that characterize any widget in a two-dimensional space.
All metrics positioning coordinates are global, meaning they are relative to the entire screen coordinate space.
RenderData also provides you an ability to get all widget keypoint XY-coordinates by calling one of special getters.
ComparisonDiff
You can get the comparison relative results for each widget keypoint from the ComparisonDiff instance.
An 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.).
Installation
Add render_metrics to your pubspec.yaml file:
dependencies:render_metrics:$currentVersion$
At this moment, the current version of render_metrics is .
Changelog
All notable changes to this project will be documented in this file.
Issues
To report your issues, submit them directly in the Issues section.
Contribute
If 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 first and send us your pull request.
Your PRs are always welcome.
How to reach us
Please feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.