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

पैकेज विवरणv3.0.1

rich_text_controller

एक विस्तारित पाठ संपादन नियंत्रक जो विभिन्न आंतरिक शैलियों के लिए कस्टम नियमित अभिव्यक्ति पैटर्न का समर्थन करता है।

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

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

flutter pub add rich_text_controller

पैकेज अवलोकन

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

rich_text_controller एक Flutter/Dart पैकेज है जो मानक टेक्स्ट संपादन कंट्रोलर को विस्तारित करता है, जिससे कस्टम नियमित अभिव्यक्तियों के आधार पर टेक्स्ट के लिए इनलाइन स्टाइलिंग संभव होती है। यह डेवलपर्स को विशिष्ट पैटर्न (जैसे हैशटैग, उल्लेख, या लिंक) के लिए विभिन्न शैलियाँ - जैसे रंग, फॉन्ट या सजावट - लागू करने की अनुमति देता है। मैसेजिंग ऐप्स, नोट-टेकिंग टूल्स या सोशल मीडिया इंटरफेस में रिच टेक्स्ट इनपुट के लिए आदर्श, यह उपयोगकर्ता अनुभव को बढ़ाता है जब संरचित सामग्री को दृश्य रूप से अलग किया जाता है। पैकेज सभी प्रमुख प्लेटफॉर्मों का समर्थन करता है और मौजूदा TextEditingController कार्यप्रवाहों के साथ बिना किसी दिक्कत के एकीकृत होता है।

उपयोग

  • स्टाइल्ड उल्लेख वाले संदेश ऐप
  • सिंटैक्स हाइलाइटिंग वाले नोट-टेकिंग एप्लिकेशन
  • हैशटैग स्टाइल वाले सोशल मीडिया टेक्स्ट फ़ील्ड
  • कस्टम रिच टेक्स्ट एडिटर
  • रियल-टाइम सहयोगात्मक संपादन

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

  • नियमित व्यंजक पैटर्न के माध्यम से इनलाइन स्टाइलिंग
  • कई शैली प्रकारों का समर्थन
  • TextEditingController के साथ निरंतर एकीकरण
  • क्रॉस-प्लेटफॉर्म संगतता
  • स्टाइल्ड टेक्स्ट का लाइव प्रीव्यू
  • कॉन्फ़िगरेबल पैटर्न मैचिंग

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

  • समृद्ध पाठ इनपुट क्षेत्र बनाने वाले डेवलपर्स
  • गतिशील पाठ स्वरूपण की आवश्यकता वाले ऐप्स
  • उपयोगकर्ता द्वारा उत्पन्न सामग्री वाले प्रोजेक्ट
  • नियम-आधारित सामग्री टैगिंग का उपयोग करने वाली टीमें
  • पैटर्न के दृश्य अंतर की आवश्यकता वाले UI

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

  • प्रदर्शन में समस्याओं से बचने के लिए ध्यान से नियमित व्यंजक डिज़ाइन की आवश्यकता होती है
  • जटिल पैटर्न के साथ मेमोरी उपयोग बढ़ सकता है
  • स्टाइलिंग तर्क को प्लेटफॉर्म के बीच परीक्षण करना आवश्यक है
  • बड़े पैमाने पर दस्तावेज़ संपादन के लिए उपयुक्त नहीं
  • सामान्य उपयोग के मामलों के लिए सीमित आंतरिक टेम्पलेट

मूल README

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

rich_text_controller

Pub Version License Pub Points

rich_text_controller is an extended text editing controller for Flutter that supports applying different inline styles based on custom regex patterns. This package simplifies text styling and interaction in Flutter applications, making it easy to create feature-rich text inputs.


Table of Contents

  1. Demo
  2. Features
  3. Installation
  4. Usage
  5. Contributing
  6. License

Demo

Demo GIF

Features

  • Custom Regex Styling: Apply styles dynamically to text patterns.
  • Interactive Callbacks: Define actions for user interactions with matched text.
  • Dynamic Updates: Modify regex patterns on the fly without recreating the controller.
  • IME Composition Support: Smooth handling for languages like Japanese and Chinese.
  • Performance Optimizations: Cached regex for better performance.
  • RichWrapper Widget: A widget for seamless integration with the controller.
  • Fine-grained Configuration: Control deletion behavior, styles, and tap actions for specific matches.

Installation

  1. Add the package to your pubspec.yaml file:
dependencies:
  rich_text_controller: ^[latest_version]
  1. Run the following command to install the package:
flutter pub get
  1. Import the package into your Dart file:
import 'package:rich_text_controller/rich_text_controller.dart';

Usage

Here's a quick example of how to use RichTextController to style specific patterns in a TextField:

Example
import 'package:flutter/material.dart';
import 'package:rich_text_controller/rich_text_controller.dart';

defaultTextStyle(BuildContext context) => TextStyle(color: Colors.black);

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('RichTextController Example')),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: TextField(
              controller: RichTextController(
                text: '',
                onMatch: (match, target) {
                  print('Match found: \$match');
                },
                targetMatches: [
                  MatchTargetItem(
                    textStyle: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
                    regex: RegExp(r'#[a-zA-Z0-9_]+'),
                  ),
                  MatchTargetItem(
                    textStyle: TextStyle(color: Colors.green),
                    regex: RegExp(r'@[a-zA-Z0-9_]+'),
                  ),
                ],
              ),
              decoration: InputDecoration(border: OutlineInputBorder()),
            ),
          ),
        ),
      ),
    );
  }
}

Contributing

Contributions are always welcome! Here’s how you can help:

  1. Report bugs or request features via GitHub Issues.
  2. Submit pull requests with well-documented code and examples.
  3. Share your thoughts and ideas to improve the package.

License

Licensed under the MIT License. You are free to use, modify, and distribute this package. See the LICENSE.md file for details.

श्रेणियाँ

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

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