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

पैकेज विवरणv5.0.0

linkify

डार्ट में निम्न स्तर के लिंक (पाठ, URL, ईमेल, फ़ोन नंबर, उपयोगकर्ता टैग) पार्सिंग पुस्तकालय।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
3.9 लाख
लाइक
182
Pub अंक
150

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

flutter pub add linkify

पैकेज अवलोकन

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

Linkify एक कम स्तर की Dart पुस्तकालय है जिसका उपयोग टेक्स्ट को पार्स करने और लिंक, URL, ईमेल पते, फ़ोन नंबर और उपयोगकर्ता टैग की पहचान करने के लिए किया जाता है। यह विभिन्न मंचों पर सामान्य टेक्स्ट से संरचित डेटा का पता लगाने और निकालने का हल है। चैट इंटरफ़ेस, सोशल मीडिया फ़ीड या कंटेंट रेंडरिंग जैसे ऐप्स के लिए आदर्श है। यह पुस्तकालय Android, iOS, Web, macOS, Windows और Linux को सपोर्ट करता है, जिससे व्यापक संगतता सुनिश्चित होती है। यह UI कंपोनेंट्स नहीं शामिल करता है, बल्कि सटीक पार्सिंग पर ध्यान केंद्रित करता है, जिससे यह कस्टम विजेट्स या टेक्स्ट प्रोसेसर में एकीकरण के लिए उपयुक्त है।

उपयोग

  • उपयोगकर्ता-उत्पादित सामग्री का विश्लेषण
  • पाठ से URL और ईमेल निकालना
  • चैट या संदेश ऐप बनाना
  • क्लिक करने योग्य लिंक के साथ पाठ प्रदर्शन में सुधार
  • सोशल मीडिया पोस्ट को संसाधित करना
  • स्वचालित संपर्क जानकारी निकास

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

  • URL, ईमेल, फ़ोन नंबर और उपयोगकर्ता टैग का समर्थन करता है
  • क्रॉस-प्लेटफॉर्म संगतता
  • हल्का और कारगर विश्लेषण
  • कोई निर्मित यूआई घटक नहीं है
  • पैटर्न डिटेक्शन में उच्च सटीकता
  • कस्टम लिंक प्रकार के लिए विस्तारयोग्य

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

  • टेक्स्ट-भारी एप्लिकेशन बना रहे डेवलपर्स
  • स्वचालित लिंक डिटेक्शन की आवश्यकता वाले ऐप्स
  • कस्टम पाठ प्रोसेसिंग पाइपलाइन
  • चैट या फोरम एप्लिकेशन
  • सामग्री रेंडरिंग प्रणाली

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

  • लिंक के दृश्य रेंडरिंग को प्रदान नहीं करता है
  • टैप हैंडलिंग के लिए हस्तकल्पित कार्यान्वयन की आवश्यकता है
  • मूल टेक्स्ट पैटर्न तक सीमित
  • जटिल HTML पार्सिंग के लिए उपयुक्त नहीं
  • कोई बिल्ट-इन स्टाइलिंग विकल्प नहीं
  • बाहरी तर्क पर आधारित इंटरैक्शन

मूल README

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

linkify pub package

Low-level link (text, URLs, emails, phone numbers, user tags) parsing library in Dart.

Required Dart >=2.12 (has null-safety support).

Flutter library.

Pub - API Docs - GitHub

Install

Install by adding this package to your pubspec.yaml:

dependencies:
  linkify: ^5.0.0

Usage

import 'package:linkify/linkify.dart';

linkify("Made by https://cretezy.com person@example.com");
// Output: [TextElement: 'Made by ', UrlElement: 'https://cretezy.com' (cretezy.com), TextElement: ' ', EmailElement: 'person@example.com' (person@example.com)]
Options

You can pass LinkifyOptions to the linkify method to change the humanization of URLs (turning https://example.com to example.com):

linkify("https://cretezy.com");
// [UrlElement: 'https://cretezy.com' (cretezy.com)]

linkify("https://cretezy.com", options: LinkifyOptions(humanize: false));
// [UrlElement: 'https://cretezy.com' (https://cretezy.com)]
  • humanize: Removes http/https from shown URLs
  • removeWww: Removes www. from shown URLs
  • looseUrl: Enables loose URL parsing (should parse most URLs such as abc.com/xyz)
    • defaultToHttps: When used with [looseUrl], default to https instead of http
  • excludeLastPeriod: Excludes . at end of URLs
Linkifiers

You can pass linkifiers to linkify as such:

linkify("@cretezy", linkifiers: [UserTagLinkifier()]);

Available linkifiers:

  • EmailLinkifier
  • UrlLinkifier
  • PhoneNumberLinkifier
  • UserTagLinkifier

Custom Linkifier

You can write custom linkifiers for phone numbers or other types of links. Look at the URL linkifier for an example.

This is the flow:

  • Calls parse in the linkifier with a list of LinkifyElement. This starts as [TextElement(text)]
  • Your parsers then splits each element into it's parts. For example, [TextElement("Hello https://example.com")] would become [TextElement("Hello "), UrlElement("https://example.com")]
  • Each parsers is ran in order of how they are passed to the main linkify function. By default, this is URL and email linkifiers

श्रेणियाँ

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

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