TxTile constructor
TxTile({
- required Widget content,
- Key? key,
- Widget? label,
- String? labelText,
- TextAlign? labelTextAlign,
- TextOverflow? labelOverflow,
- EdgeInsetsGeometry? padding,
- List<
Widget> ? actions, - TextStyle? labelStyle,
- double? horizontalGap,
- Color? tileColor,
- Axis? layoutDirection,
- Widget? trailing,
- Widget? leading,
- VisualDensity? visualDensity,
- ShapeBorder? shape,
- Color? iconColor,
- Color? textColor,
- TextStyle? leadingAndTrailingTextStyle,
- bool enabled = true,
- GestureTapCallback? onTap,
- double? minLeadingWidth,
- bool? dense,
- double? minLabelWidth,
- double? minVerticalPadding,
- bool? colon,
- bool focused = false,
- 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));