my_custom_text_package 0.0.8
my_custom_text_package: ^0.0.8 copied to clipboard
A lightweight Flutter package providing a next-gen customizable text widget and utility classes for reusable UI components.
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 Next-Gen Demo',
home: Scaffold(
appBar: AppBar(title: const Text('CustomTextWidget Next-Gen Demo')),
body: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: CustomTextWidget(
text:
'Hello Flutter! Check out #Flutter :star: This text is fully customizable!',
maxLines: 3,
textAlign: TextAlign.center,
fontSize: 24,
fontWeight: FontWeight.bold,
fontFamily: 'Roboto',
color: Colors.deepPurple,
letterSpacing: 2,
wordSpacing: 4,
selectable: true,
richTextMode: true,
preset: TextPresets.title,
gradient: LinearGradient(colors: [Colors.blue, Colors.purple]),
animatedGradient: true,
shadows: const [
Shadow(
color: Colors.black26,
offset: Offset(2, 2),
blurRadius: 3,
),
],
decoration: TextDecoration.underline,
onTapWord: (word) {
if (word.startsWith('@')) {
print("Tapped mention: $word");
} else if (word.startsWith('#')) {
print("Tapped hashtag: $word");
}
},
),
),
),
),
);
}
}