my_custom_text_package 0.0.4
my_custom_text_package: ^0.0.4 copied to clipboard
A lightweight Flutter package providing a customizable text widget and utility classes for reusable UI components.
My Custom Text Package #
A lightweight Flutter package providing a customizable text widget and utility classes for reusable UI components.
Features #
- Customizable font, size, color, letter spacing, word spacing
- Handles text overflow and max lines
- Reusable
CustomTextWidgetfor consistent UI
Requirements #
Installation #
Add this to your pubspec.yaml:
dependencies:
my_custom_text_package: ^0.0.3
Usage #
import 'package:flutter/material.dart';
import 'package:my_custom_text_package/custom_text_widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'CustomTextWidget Full Demo',
home: Scaffold(
appBar: AppBar(title: const Text('CustomTextWidget Full Demo')),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: CustomTextWidget(
text:
'This is a fully customized CustomTextWidget showcasing ALL options!',
fontSize: 24,
fontWeight: FontWeight.bold,
fontFamily: 'Roboto',
color: Colors.deepPurple,
letterSpacing: 2,
wordSpacing: 4,
maxLine: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
decoration: TextDecoration.underline,
softWrap: true,
textScaleFactor: 1.5,
textDirection: TextDirection.ltr,
style: TextStyle(
shadows: const [
Shadow(
color: Colors.black26,
offset: Offset(2, 2),
blurRadius: 3,
),
],
backgroundColor: Colors.yellow.withOpacity(0.2),
),
strutStyle: const StrutStyle(
fontSize: 24,
height: 1.5,
),
textHeightBehavior: const TextHeightBehavior(
applyHeightToFirstAscent: true,
applyHeightToLastDescent: true,
),
textWidthBasis: TextWidthBasis.longestLine,
),
),
),
),
);
}
}