सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक फ्लटर पैकेज जो पूर्व-निर्धारित फॉन्ट वेट और सुविधाजनक कस्टमाइजेशन विकल्पों के साथ टेक्स्ट स्टाइलिंग को सरल बनाता है। यह तैयार-उपयोग टेक्स्ट कॉन्फ़िगरेशन प्रदान करके डेवलपर उत्पादकता को बढ़ाता है, बॉइलरप्लेट कोड को कम करता है। विजेट कई प्लेटफॉर्म के लिए समर्थन करता है, जिसमें एंड्रॉइड, आईओएस, वेब, मैकओएस, विंडोज और लिनक्स शामिल हैं, जिससे यह क्रॉस-प्लेटफॉर्म एप्लिकेशन के लिए आदर्श है। आसानी से लागू किए जाने वाले शैली और सुसंगत टाइपोग्राफी के साथ, यह UI विकास को सरल बनाता है जबकि लचीलापन बनाए रखता है।
उपयोग
त्वरित UI प्रोटोटाइपिंग
प्लेटफॉर्म-स्थान टेक्स्ट स्टाइलिंग
स्क्रीन के बीच सुसंगत टाइपोग्राफी
पुनरावृत्ति टेक्स्ट कोड को कम करना
त्वरित थीम कार्यान्वयन
मुख्य विशेषताएँ
पूर्वनिर्धारित फ़ॉन्ट वजन
आसान स्टाइलिंग सिंटैक्स
क्रॉस-प्लेटफ़ॉर्म समर्थन
न्यूनतम बॉयलरप्लेट
कस्टमाइज़ेबल दिखावट
प्रतिक्रियाशील पाठ संभालना
इनके लिए उपयुक्त
शुरुआती Flutter विकासकर्ता
सुसंगतता को निर्धारित करने वाली टीमें
लगातार टेक्स्ट अपडेट करने वाले एप्स
त्वरित UI इटरेशन की आवश्यकता वाले प्रोजेक्ट्स
सरलता के लिए जटिलता से अधिक खोजने वाले विकासकर्ता
विचार योग्य बातें
पाठ-विशिष्ट सुविधाओं तक सीमित
जटिल एनीमेशन के लिए अनुपयुक्त
उन्नत प्रभाव के लिए अतिरिक्त पैकेज की आवश्यकता हो सकती है
विशिष्ट मामलों में रॉ टेक्स्ट विजेट्स की तुलना में कम लचीला
अपडेट्स के लिए बाहरी स्रोत कोड पर निर्भर है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Simplified Text Widget Package
A Flutter package that provides beautifully styled text widgets with enforced font consistency.
📦 Installation
Use this package as a library
🔗 Depend on it
Run this command:
With Flutter:
flutter pub add simplified_text_widget
🚀 Getting Started
[!IMPORTANT]
⚙️ Configuration
Before using the widgets, you must initialize the SimplifiedTextWidgetConfig in your main() function. This class controls the global behavior, responsiveness, and default styles for all text variants.
import'package:simplified_text_widget/simplified_text_widget.dart';
voidmain() {
SimplifiedTextWidgetConfig.config(
responsiveFonts: bool, **required** // Enable/Disable font responsiveness globally
maxSizeMultiplier: double, (optional) // Max font scale factor (Default: 1.5)
baseScreenWidth: double, (optional) // Design width for calculation (Default: 375)
defaultFontWeight: FontWeight, (optional) // Default weight for Text[size] variants
defaultColor: Color (optional) // Default color for all widgets (Default: Color(0xFF000000))
);
runApp(constMyApp());
}
Configuration Options
Property
Type
Default
Description
responsiveFonts
bool
required
Whether fonts should scale based on screen width.
maxSizeMultiplier
double
1.5
Limits how large the font can grow on large screens.
baseScreenWidth
double
375
The screen width (in logical pixels) your UI was designed for.
defaultFontWeight
DefaultFontWeight
w500
The weight used by base Text[size] variants (e.g., Text14).
defaultColor
Color
Color(0xFF000000)
The fallback color if no color is provided to a widget.
📐 How Responsiveness Works
When responsiveFonts is set to true, the font size is calculated dynamically based on the current screen width.
Example Calculations
Assuming baseScreenWidth: 375 (Default):
Initial Size
Current Width
Multiplier
Resulting Size
14px
375px (Mobile)
1.5x
14.0px
14px
562px (Tablet)
1.5x
21.0px
14px
750px (Desktop)
1.5x
21.0px (Clamped by 1.5x)
14px
750px (Desktop)
2.0x
28.0px
Features
Centrally Managed Configuration: Introducing SimplifiedTextWidgetConfig to control global defaults like color and font weight across your entire app.
Smart Responsiveness: Effortlessly scale your typography based on baseScreenWidth with built-in maxSizeMultiplier guards to ensure readability on cross platform.
Rich Debug Logging: Get instant visibility into your global setup with beautifully formatted console logs, featuring color previews for your defaultColor.
Global Default Color: Declare a fallback defaultColor (e.g., Colors.navy) during initialization to maintain brand consistency without repeating color parameters.
Base Variants: Simplified usage with Text[size] (e.g., Text14) which dynamically inherits your globally configured font weight.
[!IMPORTANT]
If migrating from an older version, add this in main() to avoid any error.
import'package:simplified_text_widget/simplified_text_widget.dart';
SimplifiedTextWidgetConfig.config(
responsiveFonts: false// false if you don't need responsiveness
);
To boost your productivity and ensure consistency, we've included a set of VS Code snippets to instantly generate styled text widgets with predefined font sizes and weights.
✅ How to Use
1. Open VS Code
2. Go to `Preferences` → `Configure Snippets`
3. Choose `dart.json` (or create if it doesn't exist)
4. Copy contents from the root `dart.json` file in this package
5. Save and restart VS Code
Now you can type shortcuts like:
t14w4 → Text14w400('Your text here')
t18w7 → Text18w700('Bold title')