render method
Implementation
@override
Widget render(BuildContext context) {
var size = style.margeSize;
var innerStyle = style.copyWith(
padding: margeSafeArea(widget.innerSafeArea, false, style.padding,
size.height, style.width),
margin: margeSafeArea(widget.outerSafeArea, false, style.margin,
size.height, style.width));
if (_options.disabled == true) {
innerStyle = innerStyle.overFrom(style.disabledStyle);
} else if (tapState) {
innerStyle = innerStyle.overFrom(style.feedbackStyle);
} else if (focusState) {
innerStyle = innerStyle.overFrom(style.focusStyle);
}
var child = innerStyle.render(widget.buildChild(context));
if (_handler.hasHandlers || style.feedbackStyle != null) {
var registry = AntdTapEventRegistryProvider.maybeOf(context);
child = _handler.wrap(child);
if (registry == null) {
child = AntdTapEventRegistryProvider(
registry: _eventRegistry, child: child);
}
}
if (innerStyle.radius != null && innerStyle.shadows == null) {
return ClipRRect(
borderRadius: innerStyle.radius!,
child: child,
);
}
if (widget.onLayout != null || widget.focusNode != null) {
return AntdBoxProvider(
focusNode: widget.focusNode,
handleSizeChange: widget.onLayout != null
? () {
execLayoutCallback(false);
}
: null,
child: child,
);
}
if (_hasFocusNode) {
child = Focus(
onFocusChange: (value) {
widget.onFocus?.call(value);
if (style.focusStyle != null && focusState != value) {
setState(() {
focusState = value;
});
}
},
focusNode: _focusNode,
child: child,
);
}
return child;
}