getRowWithBoldAndNormalText method

Widget getRowWithBoldAndNormalText({
  1. required String title,
  2. required String value,
  3. required Color color,
  4. double fontSize = 15.0,
  5. String fontFamily = "mainFontBold",
  6. String valueFontFamily = "mainFontRegular",
  7. int titleMaxLines = 1,
  8. int valueMaxLines = 1,
})

Creates a row with bold title and regular value text using SelectableText.

Displays two text elements where both are selectable by the user. Useful for displaying copyable key-value pairs.

Parameters:

  • title: The label text (rendered in bold).
  • value: The value text (rendered in regular weight).
  • color: Color applied to both text elements.
  • fontSize: Font size for both elements (defaults to 15.0).
  • fontFamily: Font family for title (defaults to "mainFontBold").
  • valueFontFamily: Font family for value (defaults to "mainFontRegular").
  • titleMaxLines: Maximum lines for title (defaults to 1).
  • valueMaxLines: Maximum lines for value (defaults to 1).

Returns a Row with two SelectableText widgets.

Example:

getRowWithBoldAndNormalText(
  title: 'Email: ',
  value: 'user@example.com',
  color: Colors.black87,
  fontSize: 14,
);

Implementation

Widget getRowWithBoldAndNormalText(
    {required String title,
    required String value,
    required Color color,
    double fontSize = 15.0,
    String fontFamily = "mainFontBold",
    String valueFontFamily = "mainFontRegular",
    int titleMaxLines = 1,
    int valueMaxLines = 1}) {
  return Row(
    children: [
      SelectableText(
        title,
        maxLines: titleMaxLines,
        style: TextStyle(
            fontFamily: fontFamily, color: color, fontSize: fontSize),
      ),
      SelectableText(
        value,
        maxLines: valueMaxLines,
        style: TextStyle(
            fontFamily: valueFontFamily, color: color, fontSize: fontSize),
      ),
    ],
  );
}