ImageTitleCommonValueWithHolderTableViewCell constructor

ImageTitleCommonValueWithHolderTableViewCell({
  1. Key? key,
  2. double? height,
  3. BoxConstraints? constraints,
  4. double? leftRightPadding,
  5. Color? color,
  6. double? leftMaxWidth,
  7. double? rightMaxWidth,
  8. double? leftRightSpacing,
  9. ImageProvider<Object>? imageProvider,
  10. double? imageWith,
  11. double? imageTitleSpace,
  12. required String title,
  13. String? titlePrompt,
  14. int? titlePromptMaxLines,
  15. double? titlePromptFontSize,
  16. required Widget? valueWidgetBuilder(
    1. BuildContext context, {
    2. required bool canExpanded,
    }),
  17. String? valuePlaceHodler,
  18. TextStyle? valuePlaceHodlerTextStyle,
  19. CJTSTableViewCellArrowImageType? arrowImageType,
  20. int? section,
  21. int? row,
  22. ClickCellCallback? onTapCell,
  23. ClickCellCallback? onDoubleTapCell,
  24. ClickCellCallback? onLongPressCell,
})

Implementation

ImageTitleCommonValueWithHolderTableViewCell({
  Key? key,
  double? height, // cell 的高度(内部已限制最小高度为44,要更改请设置 constraints)
  BoxConstraints? constraints,
  double? leftRightPadding, // cell 内容的左右间距(未设置时候,默认20)
  Color? color,
  double? leftMaxWidth,
  double? rightMaxWidth,
  double? leftRightSpacing,

  // 左侧-图片
  ImageProvider? imageProvider, // 图片(默认null时候,imageWith大于0时候才有效)
  double? imageWith, // 图片宽高(默认null,非大于0时候,图片没位置)
  double? imageTitleSpace, // 图片与标题间距(图片存在时候才有效)
  // 左侧-文本
  required String title, // 主文本
  String? titlePrompt, // 标题的说明语(此值为空时候,视图会自动隐藏)
  int? titlePromptMaxLines, // 标题的说明语的最大行数(为null时候,默认1)
  double? titlePromptFontSize, // 标题的说明语的字体大小(默认30)
  // 右侧-值视图
  required Widget? Function(BuildContext context, {required bool canExpanded})
      valueWidgetBuilder, // 值视图(此值为空时候,视图会自动隐藏)
  this.valuePlaceHodler, // 值文本占位符(默认null,不显示),且此值必须当 valueWidgetBuilder 为null才显示
  this.valuePlaceHodlerTextStyle, // 值文本的style(默认字体大小16)
  // 右侧-箭头
  CJTSTableViewCellArrowImageType? arrowImageType, // 箭头类型(默认none)

  int? section,
  int? row,
  ClickCellCallback? onTapCell, // cell 的点击
  ClickCellCallback? onDoubleTapCell, // cell 的双击
  ClickCellCallback? onLongPressCell, // cell 的长按
}) : super(
        key: key,
        height: height,
        constraints: constraints,
        leftRightPadding: leftRightPadding,
        color: color,
        leftMaxWidth: leftMaxWidth,
        rightMaxWidth: rightMaxWidth,
        leftRightSpacing: leftRightSpacing,
        imageProvider: imageProvider,
        imageWith: imageWith ?? 22.w_pt_demo,
        imageTitleSpace: imageTitleSpace ?? 10.w_pt_demo,
        title: title,
        titlePrompt: titlePrompt,
        titlePromptMaxLines: titlePromptMaxLines,
        titlePromptFontSize: titlePromptFontSize,
        valueWidgetBuilder: (BuildContext bContext,
            {required bool canExpanded}) {
          bool existTextValuePlaceHodler =
              valuePlaceHodler != null && valuePlaceHodler.isNotEmpty;

          Widget? valueWidget =
              valueWidgetBuilder(bContext, canExpanded: canExpanded);
          if (valueWidget == null && existTextValuePlaceHodler == true) {
            return HolderTableViewCellHolderWidget(
              valuePlaceHodler: valuePlaceHodler,
              valuePlaceHodlerTextStyle: valuePlaceHodlerTextStyle,
            );
          } else {
            return valueWidget;
          }
        },
        arrowImageType: arrowImageType,
        section: section,
        row: row,
        onTapCell: onTapCell,
        onDoubleTapCell: onDoubleTapCell,
        onLongPressCell: onLongPressCell,
      );