Skip to content

Commit

Permalink
Reverts "Normalize TabBarTheme (flutter#155476)" (flutter#155698)
Browse files Browse the repository at this point in the history
Reverts: flutter#155476
Initiated by: eyebrowsoffire
Reason for reverting: The newly added tests are failing in postsubmit. See https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20framework_tests_libraries/19062/overview
Original PR Author: QuncCccccc

Reviewed By: {TahaTesser}

This change reverts the following previous change:
This PR is to make preparations to make `TabBarTheme` conform to Flutter's conventions for component themes:

* Added a `TabBarThemeData` class which defines overrides for the defaults for `TabBar` properties.
* Added 2 `TabBarTheme` constructor parameters: `TabBarThemeData? data` and `Widget? child`. This is now the preferred way to configure a `TabBarTheme`:
```
TabBarTheme(
  data: TabBarThemeData(labelColor: xxx, indicatorColor: xxx, ...),
  child: TabBar(...)
)
```
  These two properties are made nullable to not break existing apps which has customized `ThemeData.tabBarTheme`.

* Changed the type of component theme defaults from `TabBarTheme` to `TabBarThemeData`.

TODO:

* Fix internal failures.
* Change the type of `ThemeData.tabBarTheme` from `TabBarTheme` to `TabBarThemeData`. This may cause breaking changes, a migration guide will be created.

Addresses the "theme normalization" sub project within flutter#91772
  • Loading branch information
auto-submit[bot] authored and thejitenpatel committed Sep 27, 2024
1 parent 1ab4d6e commit 4a6bae5
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 489 deletions.
4 changes: 2 additions & 2 deletions dev/tools/gen_defaults/lib/tabs_template.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TabsTemplate extends TokenTemplate {

@override
String generate() => '''
class _${blockName}PrimaryDefaultsM3 extends TabBarThemeData {
class _${blockName}PrimaryDefaultsM3 extends TabBarTheme {
_${blockName}PrimaryDefaultsM3(this.context, this.isScrollable)
: super(indicatorSize: TabBarIndicatorSize.label);
Expand Down Expand Up @@ -91,7 +91,7 @@ class _${blockName}PrimaryDefaultsM3 extends TabBarThemeData {
static const EdgeInsetsGeometry iconMargin = EdgeInsets.only(bottom: 2);
}
class _${blockName}SecondaryDefaultsM3 extends TabBarThemeData {
class _${blockName}SecondaryDefaultsM3 extends TabBarTheme {
_${blockName}SecondaryDefaultsM3(this.context, this.isScrollable)
: super(indicatorSize: TabBarIndicatorSize.tab);
Expand Down
Loading

0 comments on commit 4a6bae5

Please sign in to comment.