CustomTextWidget constructor
const
CustomTextWidget({
- Key? key,
- required String text,
- int maxLines = 1,
- TextAlign textAlign = TextAlign.start,
- Color? color,
- FontWeight fontWeight = FontWeight.w500,
- String fontFamily = 'regular',
- double fontSize = 16,
- double? minFontSize,
- double? maxFontSize,
- bool selectable = false,
- bool autoScale = false,
- TextOverflow overflow = TextOverflow.ellipsis,
- TextDecoration? decoration,
- List<
Shadow> ? shadows, - Gradient? gradient,
- bool animatedGradient = false,
- bool richTextMode = false,
- void onTapWord(
- String word
- TextPresets? preset,
Creates a CustomTextWidget.
All parameters are optional except text.
Example:
CustomTextWidget(
text: 'Hello @user! #Flutter',
richTextMode: true,
);
Implementation
const CustomTextWidget({
super.key,
required this.text,
this.maxLines = 1,
this.textAlign = TextAlign.start,
this.color,
this.fontWeight = FontWeight.w500,
this.fontFamily = 'regular',
this.fontSize = 16,
this.minFontSize,
this.maxFontSize,
this.selectable = false,
this.autoScale = false,
this.overflow = TextOverflow.ellipsis,
this.decoration,
this.shadows,
this.gradient,
this.animatedGradient = false,
this.richTextMode = false,
this.onTapWord,
this.preset,
});