updateDependentValues method
void
updateDependentValues(
- covariant AntdBox? oldWidget
)
override
Implementation
@override
void updateDependentValues(covariant AntdBox? oldWidget) {
super.updateDependentValues(oldWidget);
WidgetsBinding.instance.addPostFrameCallback((_) {
execLayoutCallback(false);
});
_options = AntdTapOptions(
hapticFeedback: style.hapticFeedback,
alwaysReceiveTap: style.feedbackStyle != null)
.copyFrom(style.options)
.copyFrom(widget.options)
.copyWith(
disabled: widget.disabled,
);
_hasFocusNode = widget.onFocus != null || style.focusStyle != null;
_focusNode.canRequestFocus = _options.disabled != true;
_eventRegistry = AntdTapEventRegistryProvider.maybeOf(context)?.registry ??
AntdTapEventRegistry();
_handler.registry = _eventRegistry;
_handler.options = _options;
if (_hasFocusNode && widget.onTap == null && widget.disabled != true) {
_handler.tapHandler = () {
_focusNode.requestFocus();
widget.onTap?.call();
};
} else {
_handler.tapHandler = widget.onTap;
}
_handler.doubleTapHandler = widget.onDoubleTap;
_handler.longPressHandler = widget.onLongPress;
}