सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Typeset एक Flutter पैकेज है जो WhatsApp-जैसे समृद्ध टेक्स्ट स्टाइलिंग की अनुमति देता है, जिसमें मोटा, ढीला, नीचे लाइन और अधिक शामिल है। यह विकासकर्ताओं को बैकएंड कॉन्फ़िगरेशन के माध्यम से टेक्स्ट फॉर्मेटिंग को डायनामिक रूप से चलाने की अनुमति देता है, जिससे यह संदेश ऐप या सामग्री-आधारित इंटरफ़ेस के लिए आदर्श है। सभी प्रमुख प्लेटफ़ॉर्म—Android, iOS, Web, macOS, Windows और Linux—पर बिना कठिन कस्टम विजेट्स के स्टाइल्ड टेक्स्ट के कार्यान्वयन को सरल बनाता है। इस पैकेज को एक सरल pub add कमांड के माध्यम से आसानी से एकीकृत किया जा सकता है और यह लचीले, स्केलेबल स्टाइलिंग विकल्प प्रदान करता है।
उपयोग
समृद्ध पाठ के साथ संदेश ऐप
बैकएंड से डायनामिक कंटेंट रेंडरिंग
उपयोगकर्ता-जनित प्रारूपित पाठ
सोशल मीडिया शैली के पाठ प्रदर्शन
इंटरैक्टिव शैक्षिक एप्लिकेशन
मुख्य विशेषताएँ
बैकएंड-चालित टेक्स्ट स्टाइलिंग
बोल्ड, इटैलिक, अंडरलाइन के लिए समर्थन
क्रॉस-प्लेटफॉर्म संगतता
pub के माध्यम से आसान एकीकरण
न्यूनतम बॉयलरप्लेट
रियल-टाइम शैली अपडेट
इनके लिए उपयुक्त
चैट इंटरफेस बना रहे विकासकर्मी
गतिशील पाठ स्वरूपण की आवश्यकता वाले एप्स
API के माध्यम से सामग्री प्रबंधित करने वाली टीमें
प्लेटफॉर्म के बीच सुसंगत रिच टेक्स्ट की आवश्यकता वाले प्रोजेक्ट
हल्के शैली समाधान खोज रहे फ्रंटएंड विकासकर्ता
विचार योग्य बातें
शैली परिभाषाओं के लिए सही बैकएंड संरचना की आवश्यकता होती है
उपयोगकर्ता इनपुट के लिए अतिरिक्त प्रमाणीकरण की आवश्यकता हो सकती है
अत्यधिक बड़े पाठ ब्लॉक के लिए अनअनुकूलित
मूल टेक्स्ट स्टाइल्स तक सीमित (उन्नत टाइपोग्राफी नहीं)
स्टाइल नियमों के लिए सही JSON पार्सिंग पर निर्भर करता है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
✨ TypeSet ✨
Powerful Text Styling for Flutter
Transform Your Text Experience
TypeSet brings WhatsApp, Telegram-like text styling to your Flutter apps with a powerful twist. Create rich, dynamic text experiences that can be driven by your backend or controlled directly in your UI.
With TypeSet, you can seamlessly integrate bold, italic, strikethrough, underlined text, monospace, hyperlinks, and even dynamic font sizing without complex widgets or convoluted styling code.
📱 See It In Action
TypeSet Widget
TypeSetEditingController
Craft the perfect user experience with text styling that feels natural to your users. TypeSet makes it easy to implement rich text features that would otherwise require complex custom solutions.
🚀 Getting Started
Installation
Add TypeSet to your project by including it in your pubspec.yaml:
dependencies:typeset:^2.3.0# Check pub.dev for the latest version
Then run:
flutter pub get
💎 Usage
TypeSet is designed to be as simple as using Flutter's built-in Text widget:
import'package:typeset/typeset.dart';
// Just drop in your formatted textTypeSet('Hello *Flutter* developers!');
// Hyperlink with custom tap actionTypeSet(
'§Visit Flutter\|https://flutter.dev§',
linkRecognizerBuilder: (linkText, url) =>
TapGestureRecognizer()..onTap = () {
// Your custom action here
},
);
// Dynamic font sizingTypeSet('Regular text with *bigger<24>* words');
// Escape formatting charactersTypeSet('Use the ¦* symbol to show *asterisks*');
💬 Interactive Text Editing
TypeSetEditingController
New in v2.3.0! Add WhatsApp-like styling to your text input fields with real-time formatting preview:
import'package:typeset/typeset.dart';
import'package:flutter/material.dart';
// Create a controller with optional styling parametersfinal controller = TypeSetEditingController(
// Initial text with formatting
text: 'This is *bold* and _italic_',
// Style for the formatting markers
markerColor: Colors.grey.shade400,
// Style for links
linkStyle: constTextStyle(color: Colors.blue),
// Style for bold text
boldStyle: constTextStyle(fontWeight: FontWeight.bold),
// Style for monospace text
monospaceStyle: constTextStyle(fontFamily: 'Courier'),
);
// Use it with a TextFieldTextField(
controller: controller,
maxLines: 3,
decoration: constInputDecoration(
border: OutlineInputBorder(),
hintText: 'Type formatted text here...',
),
);
Context Menu Integration
Add formatting options to the text selection context menu with getTypesetContextMenus():
import'package:typeset/typeset.dart';
import'package:flutter/material.dart';
TextField(
controller: TypeSetEditingController(),
contextMenuBuilder: (context, editableTextState) {
returnAdaptiveTextSelectionToolbar.buttonItems(
anchors: editableTextState.contextMenuAnchors,
buttonItems: [
// Add TypeSet formatting options to the context menu
...getTypesetContextMenus(
editableTextState: editableTextState,
// Optional: specify which formatting options to include// styleTypes: [StyleTypeEnum.bold, StyleTypeEnum.italic],
),
// Keep the default context menu items
...editableTextState.contextMenuButtonItems,
],
);
},
);
This adds formatting buttons (Bold, Italic, Strikethrough, etc.) to the text selection menu, allowing users to easily format selected text.
✨ Key Features
WhatsApp-like Formatting - Familiar syntax that users already understand
Backend-driven Styling - Update text formatting from your server without app updates
TypeSetEditingController - Add rich text capabilities to input fields
Dynamic Font Sizing - Adjust text size inline for emphasis or hierarchy
Context Menus - Built-in support for copy/paste with formatting
Highly Customizable - Style each formatting type independently
Lightweight - Minimal dependencies for a smaller app footprint
Well-tested - 95%+ test coverage for production reliability