ttext_widget 1.0.0
ttext_widget: ^1.0.0 copied to clipboard
Enhanced text widget with simplified styling options for Flutter.
TText Widget #
Enhanced text widget with simplified styling options for Flutter.
Features #
- 🎨 Easy Styling: Simple string-based style constants
- 🌈 Color Presets: 20+ built-in color constants
- ✨ Text Effects: Shadow and letter spacing support
- 🔤 Text Transform: Uppercase conversion
- ⚡ Lightweight: No external dependencies
Installation #
Add this to your pubspec.yaml:
dependencies:
ttext_widget: ^1.0.0
Or install via command line:
flutter pub add ttext_widget
Usage #
Basic Example #
import 'package:flutter/material.dart';
import 'package:ttext_widget/ttext_widget.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: TText(
'Hello World',
size: 24,
color: TText.blue,
style: TText.bold,
),
),
),
);
}
}
Font Weight Styles #
TText('Thin Text', style: TText.w100)
TText('Light Text', style: TText.w300)
TText('Normal Text', style: TText.w400)
TText('Medium Text', style: TText.w500)
TText('Bold Text', style: TText.bold)
TText('Extra Bold', style: TText.w800)
Text Decorations #
TText('Italic Text', style: TText.italic)
TText('Underlined', style: TText.underline)
TText('Bold Italic', style: TText.boldItalic)
Colors #
TText('Red Text', color: TText.red)
TText('Blue Text', color: TText.blue)
TText('Green Text', color: TText.green)
TText('Purple Text', color: TText.purple)
Available colors: black, white, red, blue, green, yellow, orange, pink, purple, deepPurple, indigo, teal, cyan, brown, grey, blueGrey, amber, lime, lightBlue, lightGreen, deepOrange
Advanced Features #
// Uppercase transformation
TText('hello world', uppercase: true) // displays "HELLO WORLD"
// Text shadow
TText('Shadow Text', shadow: true)
// Letter spacing
TText('Spaced Text', spacing: 2.0)
// Combined features
TText(
'Styled Text',
size: 32,
color: TText.deepPurple,
style: TText.bold,
uppercase: true,
shadow: true,
spacing: 1.5,
)
Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
String |
required | The text to display |
size |
double? |
18 |
Font size |
color |
Color? |
TText.black |
Text color |
style |
String? |
null |
Style identifier (w100-w900, bold, italic, etc.) |
uppercase |
bool |
false |
Transform text to uppercase |
shadow |
bool |
false |
Add shadow effect |
spacing |
double |
0 |
Letter spacing |
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
MIT License - see LICENSE file for details.
Author #
Your Name - @yourhandle