childText method

Text childText({
  1. Object? text,
  2. AFWidgetID? wid,
  3. dynamic style,
  4. dynamic textColor,
  5. dynamic fontSize,
  6. dynamic fontWeight,
  7. TextAlign? textAlign,
  8. TextOverflow? overflow,
  9. int? maxLines,
  10. bool? softWrap,
})

@see translate for all the ways text can be specified.

Implementation

Text childText({
  Object? text,
  AFWidgetID? wid,
  dynamic style,
  dynamic textColor,
  dynamic fontSize,
  dynamic fontWeight,
  TextAlign? textAlign,
  TextOverflow? overflow,
  int? maxLines,
  bool? softWrap,
}) {
  TextStyle? styleS;
  if(style != null) {
    styleS = styleText(style);
  }

  if(textColor != null || fontSize != null || fontWeight != null) {
    styleS = TextStyle(
      color: color(textColor) ?? styleS?.color,
      fontSize: size(fontSize) ?? styleS?.fontSize,
      fontWeight: weight(fontWeight) ?? styleS?.fontWeight
    );
  }

  var textT = translate(wid: wid, text: text);
  return Text(textT,
    key: keyForWID(wid),
    style: styleS,
    textAlign: textAlign,
    textScaleFactor: deviceTextScaleFactor,
    overflow: overflow,
    maxLines: maxLines,
    softWrap: softWrap,
  );
}