buildHeading function
Row
buildHeading({
- required String text,
- required double fontSize,
- FontWeight? fontWeight,
- Color? color,
- double? padding,
Build a heading widget with customisable style.
Arguments:
text- The text to display.fontSize- The font size.fontWeight- The font weight (optional).color- The text colour (optional).padding- The padding around the text (optional).
Implementation
Row buildHeading({
required String text,
required double fontSize,
FontWeight? fontWeight,
Color? color,
double? padding,
}) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: Padding(
padding: padding == null ? EdgeInsets.zero : EdgeInsets.all(padding),
child: Text(
text,
style: TextStyle(
fontSize: fontSize,
fontWeight: fontWeight ?? FontWeight.normal,
color: color ?? Colors.black,
),
),
),
),
],
);
}