tabHasTextAndIcon property Null safety

bool tabHasTextAndIcon

Returns whether the TabBar contains a tab with both text and icon.

TabBar uses this to give uniform padding to all tabs in cases where there are some tabs with both text and icon and some which contain only text or icon.

Implementation

bool get tabHasTextAndIcon {
  for (final Widget item in tabs) {
    if (item is PreferredSizeWidget) {
      if (item.preferredSize.height == _kTextAndIconTabHeight) {
        return true;
      }
    }
  }
  return false;
}