एक सहायक गणित क्लास जो Matrix4 परिवर्तनों को आसानी से बनाने में मदद करता है, जिन्हें आप Container के transform पैरामीटर और अन्य जगहों पर उपयोग कर सकते हैं।
सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक हल्का डार्ट उपयोगिता पैकेज जो फ्लटर में 2D और 3D ग्राफिक्स के लिए Matrix4 परिवर्तनों के निर्माण को सरल बनाता है। यह Container जैसे विंडजेट के साथ transform पैरामीटर के उपयोग के लिए परिवर्तन मैट्रिक्स बनाने के लिए सुविधाजनक विधियाँ प्रदान करता है, जिससे घूर्णन, स्केलिंग, ट्रांसलेशन और स्केविंग को सटीक नियंत्रित किया जा सकता है। एनिमेशन, कस्टम लेआउट और उन्नत परिवर्तन की आवश्यकता वाले इंटरैक्टिव यूआई तत्वों के लिए आदर्श। पैकेज प्लेटफॉर्म-अनिर्भर है और फ्लटर प्रोजेक्ट में बिना किसी दिक्कत के एकीकृत हो जाता है।
उपयोग
जटिल परिवर्तन के साथ UI तत्वों को एनीमेट करना
कस्टम 2D/3D लेआउट बनाना
गतिशील हस्तकौशल आधारित इंटरफेस बनाना
कैमरा या दृश्य घूर्णन कार्यान्वयन करना
स्केलेबल गेम या विज़ुअलाइज़ेशन कंपोनेंट्स का डिज़ाइन करना
मुख्य विशेषताएँ
सरल, श्रृंखलाबद्ध मैट्रिक्स निर्माण
रोटेशन, स्केल, ट्रांसलेशन और स्क्यू का समर्थन करता है
सामान्य ट्रांसफॉर्म ऑपरेशन के लिए सहज API
Container के transform गुण के साथ सीधे काम करता है
हल्का और निर्भरता-मुक्त
इनके लिए उपयुक्त
सटीक मैट्रिक्स नियंत्रण की आवश्यकता वाले Flutter विकासकर्ता
एनिमेटेड या इंटरैक्टिव लेआउट पर काम कर रहे UI डिज़ाइनर
खेल या विज़ुअलाइज़ेशन ऐप निर्माता
फ्लटर में 3D ट्रांसफॉर्म के बारे में सीखने वाले शुरुआती लोग
विचार योग्य बातें
भारी गणितीय गणनाओं के लिए नहीं बनाया गया है
Matrix4 अवधारणाओं के समझ की आवश्यकता है
परिवर्तन से संबंधित उपकरणों तक सीमित
कोई निर्मित एनीमेशन समर्थन नहीं है
गतिशील प्रभावों के लिए एनिमेशन कंट्रोलर के साथ सबसे अच्छा उपयोग किया जाता है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
matrix4_transform
Have you noticed the transform parameter in the Container and Transform widgets,
which lets you move, rotate, resize, and flip?
This package provides a helper math class that makes it easy to create Matrix4
transformations.
Example:
// Rotates the Container 45 degrees and then
// translates 25 pixels to the right.
Container(
transform:
Matrix4Transform()
.rotateDegrees(45, origin: Offset(25, 25))
.translate(x: 25)
.matrix4,
child: ...
);
To see it in action, run the example in
the example tab.
How to use it
Matrix4Transform is immutable (in contrast, Matrix4 is mutable).
First create a Matrix4Transform:
Matrix4Transform();
Then call the methods to transform it. For example:
A Matrix4TransformTween is provided in this package, and can be used in animations.
Animate it
A Matrix4Transform can be used to animate:
AlignPositioned or AnimatedAlignPositioned widgets from
the AlignPositioned package,
that accept a Matrix4Transform directly. The center of rotation/scale can be defined
by their alignment parameter.
Any widget that accepts a Matrix4 transformation parameter, like Container,
or AnimatedContainer. Note: Since Matrix4Tween will not animate linearly as you'd
expect, it's possible that the intermediary transformations will be "strange", although
the start and end should be correct.
Special thanks to Martin Kamleithner and Simon Lightfoot.