XButton constructor
const
XButton({
- Key? key,
- required Function onPressed,
- VoidCallback? onLongPress,
- ValueChanged<
bool> ? onHover, - ValueChanged<
bool> ? onFocusChange, - String? label,
- double? radius,
- XButtonStyle? style,
- ButtonStyle? elevatedButtonStyle,
- FocusNode? focusNode,
- bool autofocus = false,
- Clip? clipBehavior,
- WidgetStatesController? statesController,
- TextStyle? textStyle,
- XButtonState? state,
- bool isLoading = false,
- bool isLoadingInside = false,
- String? loadingLabel,
- String successLabel = 'Success',
- String errorLabel = 'Try again',
- Widget? loadingChild,
- Widget? successChild,
- Widget? errorChild,
- Widget? loadingIndicator,
- Widget successIcon = const Icon(Icons.check),
- Widget errorIcon = const Icon(Icons.refresh),
- Duration stateTransitionDuration = const Duration(milliseconds: 200),
- bool isEnable = true,
- bool? isForceTap = false,
- Widget? child,
- double? width,
- double? height,
- bool widthInfinity = false,
- XLook look = XLook.standard,
Implementation
const XButton({
super.key,
required this.onPressed,
this.onLongPress,
this.onHover,
this.onFocusChange,
this.label,
this.radius,
this.style,
this.elevatedButtonStyle,
this.focusNode,
this.autofocus = false,
this.clipBehavior,
this.statesController,
this.textStyle,
this.state,
this.isLoading = false,
this.isLoadingInside = false,
this.loadingLabel,
this.successLabel = 'Success',
this.errorLabel = 'Try again',
this.loadingChild,
this.successChild,
this.errorChild,
this.loadingIndicator,
this.successIcon = const Icon(Icons.check),
this.errorIcon = const Icon(Icons.refresh),
this.stateTransitionDuration = const Duration(milliseconds: 200),
this.isEnable = true,
this.isForceTap = false,
this.child,
this.width,
this.height,
this.widthInfinity = false,
this.look = XLook.standard,
});