TxTile constructor

TxTile({
  1. required Widget content,
  2. Key? key,
  3. Widget? label,
  4. String? labelText,
  5. TextAlign? labelTextAlign,
  6. TextOverflow? labelOverflow,
  7. EdgeInsetsGeometry? padding,
  8. List<Widget>? actions,
  9. TextStyle? labelStyle,
  10. double? horizontalGap,
  11. Color? tileColor,
  12. Axis? layoutDirection,
  13. Widget? trailing,
  14. Widget? leading,
  15. VisualDensity? visualDensity,
  16. ShapeBorder? shape,
  17. Color? iconColor,
  18. Color? textColor,
  19. TextStyle? leadingAndTrailingTextStyle,
  20. bool enabled = true,
  21. GestureTapCallback? onTap,
  22. double? minLeadingWidth,
  23. bool? dense,
  24. double? minLabelWidth,
  25. double? minVerticalPadding,
  26. bool? colon,
  27. bool focused = false,
  28. Color? focusColor,
})

Implementation

TxTile({
  required this.content,
  super.key,
  Widget? label,
  String? labelText,
  this.labelTextAlign,
  this.labelOverflow,
  this.padding,
  this.actions,
  this.labelStyle,
  this.horizontalGap,
  this.tileColor,
  this.layoutDirection,
  this.trailing,
  this.leading,
  this.visualDensity,
  this.shape,
  this.iconColor,
  this.textColor,
  this.leadingAndTrailingTextStyle,
  this.enabled = true,
  this.onTap,
  this.minLeadingWidth,
  this.dense,
  this.minLabelWidth,
  this.minVerticalPadding,
  this.colon,
  this.focused = false,
  this.focusColor,
})  : assert(
        label == null || labelText == null,
        'label 和 labelText 最多指定一个',
      ),
      assert(
        actions == null || trailing == null,
        'actions 和 trailing 最多指定一个',
      ),
      label = label ?? (labelText == null ? null : Text(labelText));