Skip to content

TabBar indicatorWeight is not ignored as documented  #171951

@qeepcologne

Description

@qeepcologne

Steps to reproduce

  1. define tabBarTheme with indicator
  2. use TabBar like

Expected results

documentation in tabs.dart says:

  /// If [indicator] is not null or provided from [TabBarTheme],
  /// then [indicatorWeight] and [indicatorColor] are ignored.

Actual results

IndicatorWeight is not ignored, 2 pixels are inserted.
Because it is not possible to set value to zero, i used indicatorWeight: 0.0000001 in TabBar as workaround

Code sample

  tabBarTheme: Theme.of(context).tabBarTheme.copyWith(
    unselectedLabelColor: neutral800,
    unselectedLabelStyle: const TextStyle(fontWeight: FontWeight.w600, fontSize: 13),
    labelColor: neutral800,
    labelStyle: TextStyle(fontWeight: FontWeight.w600, fontSize: 13),
    indicatorColor: red500,
    dividerColor: Colors.transparent,
    indicator: BoxDecoration(
      color: neutral100,
      borderRadius: BorderRadius.circular(smallBorderRadius),
      border: BoxBorder.fromBorderSide(BorderSide(color: neutral800)),
    ),
    indicatorSize: TabBarIndicatorSize.tab,
  ),
  TabBar(
    padding: EdgeInsets.symmetric(horizontal: mediumPadding / 2),
    indicatorPadding: EdgeInsetsGeometry.symmetric(vertical: mediumPadding / 2),
    controller: controller,
    tabs: tabs,
    onTap: onTap,
  ),

Flutter Doctor output

[✓] Flutter (Channel stable, 3.32.6, on Ubuntu Questing Quokka (development branch) 6.15.5-061505-generic, locale
    en_DE.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1.2)
[✓] Connected device (2 available)
[✓] Network resources

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy