buildTab method

  1. @protected
Widget buildTab(
  1. BuildContext context
)

Builds the final Tab with either a custom builder or a factory wrapper.

Implementation

@protected
Widget buildTab(BuildContext context) {
  Widget content = buildContent(context);

  // Rotate the content if needed
  if (rotate ?? false || rotateTurns != null) {
    content = RotatedBox(quarterTurns: rotateTurns ?? 3, child: content);
  }

  // 1️⃣ If a completely custom wrapper is provided, use it.
  if (wrapperModel?.customWrapperBuilder != null) {
    return Tab(
      height: height,
      child: wrapperModel?.customWrapperBuilder!(context, content),
    );
  }

  // 2️⃣ Otherwise, use the factory with the provided model or defaults.
  final wrapper = WidgetWrapperFactory.create(
    model: wrapperModel ?? const WrapperModel(),
  );

  return Tab(height: height, child: wrapper.wrap(content));
}