buildTabBar method

  1. @protected
Widget buildTabBar(
  1. BuildParameters params
)

Implementation

@protected
Widget buildTabBar(BuildParameters params) {
  var tabs = <Widget>[];
  if (params.widgets["tabs"] != null) {
    for (Map childSpec in params.widgets["tabs"] as List<Map>) {
      tabs.add(builder.buildWidget(
          params.context, childSpec, params.state, params.parentContext));
    }
  }

  final overlayColor = tryParseColor(params.props["overlayColor"]);
  return TabBar(
    key: properties.getKey(params.id),
    tabs: tabs,
    padding: params.buildProp("padding"),
    indicator: params.buildProp("indicator"),
    indicatorColor: tryParseColor(params.props["indicatorColor"]),
    indicatorPadding: params.buildProp("indicatorPadding") ?? EdgeInsets.zero,
    indicatorSize: params.buildProp("indicatorSize"),
    indicatorWeight:
        parseDouble(params.props["indicatorWeight"], defaultValue: 2.0),
    isScrollable: parseBool(params.props["isScrollable"]),
    labelColor: tryParseColor(params.props["labelColor"]),
    labelPadding: params.buildProp("labelPadding"),
    labelStyle: params.buildProp("labelStyle"),
    unselectedLabelColor: tryParseColor(params.props["unselectedLabelColor"]),
    unselectedLabelStyle: params.buildProp("unselectedLabelStyle"),
    dividerColor: tryParseColor(params.props["dividerColor"]),
    dividerHeight: tryParseDouble(params.props["dividerHeight"]),
    overlayColor: overlayColor != null
        ? WidgetStatePropertyAll<Color>(overlayColor)
        : null,
  );
}