render method
Implementation
@override
Widget render(BuildContext context) {
super.render(context);
return AntdBox(
style: style.bodyStyle,
onLayout: (ctx) {
renderBox = ctx.renderBox;
},
child: AntdRow(
style: style.childRowStyle,
children: widget.items.map((item) {
var index = widget.items.indexOf(item);
return Expanded(
child: AntdBox(
style: style.childStyle,
onTap: () {
if (renderBox == null) {
return;
}
setState(() {
currentIndex = index;
});
if (!opened) {
open(
AntdMaskHole(
hitTest: true,
offset: Offset.zero,
size: Size(double.infinity, getOffsetY())),
false);
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
item.child(index == currentIndex),
AntdIconWrap(
style: style.iconStyle,
child: (index == currentIndex
? (widget.activeIcon ?? style.activeIcon)
: (widget.icon ?? style.icon)))
],
),
));
}).toList()),
);
}