custom method
Widget
custom(
- BuildContext context,
- String? text, {
- int? maxLines,
- TextAlign? textAlign,
- Color? color,
- double? height,
- TextDecoration? decoration,
- required FontWeight fontWeight,
- required double fontSize,
- String? font,
Implementation
Widget custom(BuildContext context, String? text,
{int? maxLines,
TextAlign? textAlign,
Color? color,
double? height,
TextDecoration? decoration,
required FontWeight fontWeight,
required double fontSize,
String? font}) {
return Text(
text ?? '',
textAlign: textAlign ?? TextAlign.start,
maxLines: maxLines,
overflow: maxLines != null ? TextOverflow.ellipsis : null,
style: TextStyle(
fontFamily: font ?? Theme.of(context).textTheme.bodyMedium!.fontFamily,
color: color ?? Theme.of(context).textTheme.bodyMedium!.color,
fontSize: fontSize,
fontWeight: fontWeight,
height: height ?? textHeight,
decoration: decoration ?? TextDecoration.none,
),
);
}