valueRichTextInfo static method

InfoModal valueRichTextInfo(
  1. String keyTitle,
  2. String valueTitle, {
  3. double? fontSize,
  4. required double itemSpacing,
  5. TextStyle? valueTextStyle,
  6. bool isArrow = false,
  7. HyperLinkCallback? richTextLinkClick,
  8. VoidCallback? valueClickCallback,
  9. PairInfoTableConfig? themeData,
})

value是富文本

Implementation

static InfoModal valueRichTextInfo(
  String keyTitle,
  String valueTitle, {
  double? fontSize,
  required double itemSpacing,
  TextStyle? valueTextStyle,
  bool isArrow = false,
  HyperLinkCallback? richTextLinkClick,
  VoidCallback? valueClickCallback,
  PairInfoTableConfig? themeData,
}) {
  themeData ??= PairInfoTableConfig();
  themeData = BaseThemeConfig.instance
      .getConfig(configId: themeData.configId)
      .pairInfoTableConfig
      .merge(themeData);
  themeData = themeData.merge(PairInfoTableConfig(
      itemSpacing: itemSpacing,
      keyTextStyle: BaseTextStyle(fontSize: fontSize),
      valueTextStyle: BaseTextStyle(fontSize: fontSize)
          .merge(BaseTextStyle.withStyle(valueTextStyle))));

  return InfoModal(
      keyPart: keyTitle,
      valuePart: Padding(
        padding: EdgeInsets.only(left: itemSpacing),
        child: ExcludeSemantics(
          child: BrnCSS2Text.toTextView(valueTitle,
              maxLines: isArrow ? 1 : null,
              textOverflow:
                  isArrow ? TextOverflow.ellipsis : TextOverflow.clip,
              defaultStyle: themeData.valueTextStyle.generateTextStyle(),
              linksCallback: (text, url) {
            if (richTextLinkClick != null) {
              richTextLinkClick(text, url);
            }
          }),
        ),
      ),
      valueClickCallback: valueClickCallback,
      isArrow: isArrow);
}