Skip to content

Move TabBarView (and friends) to flutter/widgets.dart #175592

Open

Description

@Albert221

This can be classified as part of #53059.

The TabBar widget is strictly Material design.

But! The TabBarView and a few of the more technical classes/widgets like DefaultTabController or TabController have nothing in common with Material design. These could be safely kept in flutter/widgets.dart so that we can retain the behavior of changing tabs while skipping the in-between ones with either a Material TabBar (from flutter/material.dart) or with a 3rd party/custom tab bar implementation.

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    c: proposalA detailed proposal for a change to Flutter
    refactorImproving readability/efficiency without behavioral changes
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Sep 19, 2025
  2. added
    P3Issues that are less important to the Flutter project
    triaged-designTriaged by Design Languages team
    on Sep 24, 2025
  3. dkwingsmt commented on Sep 24, 2025

    @dkwingsmt
    Contributor

    Tab bars are indeed common design patterns. Cupertino also has its own tab bar widget. I think in general having some form of a tab bar widget in the widgets library is reasonable, although the exact form still needs more discussion. For example, an alternative way would be to introduce a RawTabBar. Anyway, this should not be executed at least until material and cupertino have been moved to their individual packages.

    Also related: #97496

  4. justinmc commented on Aug 7, 2026

    @justinmc
    Contributor

    I agree with this. We should investigate a RawTabBar abstraction between TabBar and CupertinoTabBar as @dkwingsmt said, and move over other related classes that are not specific to Material.

  5. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  6. navaronbracke commented on Oct 1, 2026

    @navaronbracke
    Contributor

    I think I'll look into this, since it partially blocks decoupling test/widgets/navigator_test.dart, for the decoupling project.

    Maybe I can move some things over already.

  7. navaronbracke commented on Oct 2, 2026

    @navaronbracke
    Contributor

    TabController & TabBarView seem easy to move out of Material. (no real dependency on Material) Cupertino does not yet use a TabController, so there's a bit of friction there.

    The Tab class can also be moved out of Material fairly easily. (we can probably provide parameters for the things like tab height)

    TabBar on the other hand is quite complex, because it has a bunch of Material specific things baked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.refactorImproving readability/efficiency without behavioral changesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions