showHeading method
Creates a heading text widget with customizable styling.
Displays text with configurable font, size, weight, and alignment. Suitable for section headings and titles.
Parameters:
name: The text content to display.maxLines: Maximum number of lines (defaults to 2).softWrap: Whether the text should break at soft line breaks (defaults to true).fontSize: Font size. Defaults toUtils.appFontFamily.textSize16.height: Line height multiplier (defaults to 1).fontWeight: Font weight. Defaults to FontWeight.w500.fontFamily: Font family. Defaults toUtils.appFontFamily.interSemiBoldFontFamily.textAlign: Text alignment. Defaults to TextAlign.left.color: Text color (defaults to grey).
Returns a Text widget with the specified styling.
Example:
showHeading(
name: 'Section Title',
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black,
);
Implementation
Widget showHeading(
{required String name,
int maxLines = 2,
bool softWrap = true,
double? fontSize,
double height = 1,
FontWeight? fontWeight,
String? fontFamily,
TextAlign? textAlign,
Color color = Colors.grey}) {
return Text(
name,
softWrap: softWrap,
maxLines: maxLines,
style: TextStyle(
fontSize: fontSize ?? Utils.appFontFamily.textSize16,
color: color,
fontWeight: fontWeight ?? FontWeight.w500,
height: height,
fontFamily: fontFamily ?? Utils.appFontFamily.interSemiBoldFontFamily,
),
textAlign: textAlign ?? TextAlign.left,
);
}