ClearButton constructor
const
ClearButton(
- TextEditingController _controller, {
- Widget icon = defaultIcon,
- VoidCallback? onPressed,
- double? iconSize,
- VisualDensity? visualDensity,
- EdgeInsetsGeometry? padding,
- AlignmentGeometry? alignment,
- double? splashRadius,
- Color? color,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- Color? disabledColor,
- ValueChanged<
bool> ? onHover, - VoidCallback? onLongPress,
- MouseCursor? mouseCursor,
- FocusNode? focusNode,
- bool autofocus = false,
- String? tooltip,
- bool? enableFeedback,
- BoxConstraints? constraints,
- ButtonStyle? style,
- bool? isSelected,
- Widget? selectedIcon,
- Key? key,
- MaterialStatesController? statesController,
- Widget whenEmptyChild = UiConstants.placeholder,
- Curve firstCurve = UiConstants.switchOutCurve,
- Curve secondCurve = UiConstants.switchInCurve,
- Curve sizeCurve = UiConstants.switchOutCurve,
- Duration duration = UiConstants.duration,
- AnimatedCrossFadeBuilder layoutBuilder = AnimatedCrossFade.defaultLayoutBuilder,
- bool excludeBottomFocus = true,
- Duration? reverseDuration,
Constructor for the ClearButton class.
TextEditingController is the only mandatory field here and it's a text
editing controller to listen to. Other parameters are simply passed to the
super constructor of IconButton and AnimatedCrossFade. When the text
editing controller's text is empty, the whenEmptyChild is shown instead
of the IconButton.
Implementation
const ClearButton(
this._controller, {
super.icon = defaultIcon,
super.onPressed,
super.iconSize,
super.visualDensity,
super.padding,
super.alignment,
super.splashRadius,
super.color,
super.focusColor,
super.hoverColor,
super.highlightColor,
super.splashColor,
super.disabledColor,
super.onHover,
super.onLongPress,
super.mouseCursor,
super.focusNode,
super.autofocus,
super.tooltip,
super.enableFeedback,
super.constraints,
super.style,
super.isSelected,
super.selectedIcon,
super.key,
super.statesController,
this.whenEmptyChild = UiConstants.placeholder,
this.firstCurve = UiConstants.switchOutCurve,
this.secondCurve = UiConstants.switchInCurve,
this.sizeCurve = UiConstants.switchOutCurve,
this.duration = UiConstants.duration,
this.layoutBuilder = AnimatedCrossFade.defaultLayoutBuilder,
this.excludeBottomFocus = true,
this.reverseDuration,
});