पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

polygon कवर
पैकेज विवरणv0.1.0

polygon

बहुभुज आकृतियों को बनाने और उन्हें काटने का एक सरल तरीका।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
2.2 हज़ार
लाइक
49
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add polygon

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

polygon पैकेज फ्लटर एप्लिकेशन में बहुभुज आकृतियों के निर्माण और क्लिप करने का एक सीधा तरीका प्रदान करता है। यह विकासकर्ताओं को बिंदुओं की सूची का उपयोग करके कस्टम बहुभुज पथ परिभाषित करने की अनुमति देता है, जिससे जटिल ज्यामितीय आकृतियों को रेंडर करना आसान हो जाता है। पैकेज क्लिप ऑपरेशन का समर्थन करता है, जिससे सामग्री को बहुभुज सीमाओं के भीतर सीमित किया जा सकता है, ताकि रचनात्मक दृश्य प्रभाव प्राप्त किए जा सकें। गैर-आयताकार लेआउट या अंतरक्रियात्मक आकृति-आधारित इंटरफ़ेस वाले UI डिज़ाइन के लिए आदर्श है, यह सभी प्रमुख प्लेटफॉर्म्स जैसे Android, iOS, Web, macOS, Windows और Linux पर बिना किसी समस्या के काम करता है।

उपयोग

  • कस्टम आकार के कंटेनर बनाना
  • बहुभुज सीमाओं के लिए क्लिपिंग विजेट्स
  • इंटरैक्टिव ज्यामितीय यूआई का डिज़ाइन करना
  • अनियमित आकार के साथ गेम या मैप इंटरफ़ेस बनाना
  • एनिमेटिंग बहुभुज संक्रमण

मुख्य विशेषताएँ

  • सरल बहुभुज पथ निर्माण
  • निर्मित क्लिपिंग समर्थन
  • क्रॉस-प्लेटफॉर्म संगतता
  • मौजूदा फ्लटर विजेट्स के साथ आसान एकीकरण
  • गतिशील बिंदु अपडेट का समर्थन

इनके लिए उपयुक्त

  • अद्वितीय आकार व्यवस्था की खोज में UI डिज़ाइनर
  • खेल या मानचित्र बनाने वाले विकासकर्ता
  • गैर-आयताकार क्लिपिंग वाले ऐप्स
  • ज्यामितीय इंटरफेस का प्रोटोटाइपिंग
  • कई प्लेटफॉर्म के लिए लक्षित प्रोजेक्ट

विचार योग्य बातें

  • जटिल बहुभुज के साथ प्रदर्शन में भिन्नता हो सकती है
  • सही रेंडरिंग के लिए बिंदु क्रम का सावधानीपूर्वक निपटान आवश्यक है
  • उच्च आवृत्ति अपडेट के लिए अनअनुकूलित
  • 2D आकार संचालन तक सीमित
  • टकराव का पता लगाने के लिए अतिरिक्त तर्क की आवश्यकता हो सकती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

polygon

Create any polygon easily in Flutter with this package!

Pub Donate

https://user-images.githubusercontent.com/9378033/181354646-63d1d8aa-315e-4ef4-8ff3-e5c3a15341bb.mov

Features

  • Create regular convex polygons.
  • Create regular star polygons.
  • Create a polygon border.
  • Clip any widget with a polygon shape.

Usage

Create a Polygon

With this package you can easily create any kind of polygons by just setting its vertices (in a [(-1,-1);(1,1)] rect).

const polygon = Polygon([
  Offset(0.25, -1),
  Offset(0, -0.25),
  Offset(0.5, 0),
  Offset(-0.25, 1),
  Offset(0, 0.25),
  Offset(-0.5, 0),
]);

You can then create a path from this polygon by using its computePath method. For example you can use it in a CustomPainter:

class PolygonPainter extends CustomPainter {
  PolygonPainter(this.polygon);

  final Polygon polygon;

  @override
  void paint(Canvas canvas, Size size) {
    canvas.drawPath(
      polygon.computePath(rect: Offset.zero & size),
      Paint()..color = Colors.yellow.shade800,
    );
  }

  @override
  bool shouldRepaint(PolygonPainter oldDelegate) {
    return oldDelegate.polygon != polygon;
  }
}

sharp

The computePath methods accepts various parameters and you can, for example apply a corner radius to all of the polygon's corners:

rounded

PolygonBorder

This package has also a dedicated ShapeBorder called PolygonBorder, so that you can easily apply a color, a border, an image to the polygon or clip anything through Clip.shape.

DecoratedBox(
  decoration: ShapeDecoration(
    shape: PolygonBorder(
      polygon: polygon,
      turn: 0.125,
      radius: 20.0,
      borderAlign: BorderAlign.outside,
      side:  BorderSide(
        width: 4,
        color: Colors.red,
      ),
    ),
    color: Colors.pink,
  ),
  child: const SizedBox(
    height: 400,
    width: 400,
  ),
),
Specialized polygons.

This package comes with two specialized polygons: A RegularConvexPolygon which can create triangles, tetragons, pentagons, etc. A RegularStarPolygon which can create various star shapes.

https://user-images.githubusercontent.com/9378033/181354589-1c12b68b-2ecc-4ded-a46b-16fe03d6cd57.mov

Sponsoring

I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me. By doing so, I will prioritize your issues or your pull-requests before the others.

Changelog

Please see the Changelog page to know what's recently changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 1 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट