performLayout method
Called to perform the actual layout computation for this render object.
Implementation
@override
void performLayout(Constraints constraints) {
int totalWidth = 0;
for (final tab in _tabs) {
final int textLen = stringWidth(tab.text ?? '');
final int iconLen =
(tab.icon != null) ? charWidth(tab.icon!.codeUnitAt(0)) : 0;
final int contentLen = textLen + iconLen;
totalWidth += labelPadding.left + contentLen + labelPadding.right;
}
if (_tabs.isNotEmpty && _tabs.length > 1) {
totalWidth += _tabs.length - 1;
}
size = Size(totalWidth, 2);
}