buildHeaderBoldWithHash function

Widget buildHeaderBoldWithHash(
  1. BuildContext context,
  2. String name, {
  3. int? maxLines,
  4. bool? softWrap,
  5. Color? textColor,
  6. bool isMandatory = false,
})

Implementation

Widget buildHeaderBoldWithHash(BuildContext context, String name,
    {int? maxLines,
    bool? softWrap,
    Color? textColor,
    bool isMandatory = false}) {
  return Container(
    constraints: const BoxConstraints(
      minWidth: 250.0,
      maxWidth: 250.0,
    ),
    child: RichText(
      textAlign: TextAlign.left,
      text: TextSpan(
        text: name,
        style: TextStyles.normalBold(context, textColor: textColor),
        children: isMandatory
            ? [
                const TextSpan(
                  text: ' *',
                  style: TextStyle(
                    color: Colors.red,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ]
            : [],
      ),
      maxLines: maxLines,
      softWrap: softWrap ?? false,
      overflow: TextOverflow.ellipsis,
    ),
  );
}