Skip to content

Conversation

@QuncCccccc
Copy link
Contributor

@QuncCccccc QuncCccccc commented Sep 20, 2024

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 #91772

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Sep 20, 2024
@QuncCccccc QuncCccccc marked this pull request as ready for review September 24, 2024 21:51
Copy link
Member

@TahaTesser TahaTesser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! LGTM!

@QuncCccccc QuncCccccc added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 25, 2024
@auto-submit auto-submit bot merged commit f310625 into flutter:master Sep 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 25, 2024
@eyebrowsoffire
Copy link
Contributor

@eyebrowsoffire eyebrowsoffire added the revert Autorevert PR (with "Reason for revert:" comment) label Sep 25, 2024
auto-submit bot pushed a commit that referenced this pull request Sep 25, 2024
@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Sep 25, 2024
auto-submit bot added a commit that referenced this pull request Sep 25, 2024
Reverts: #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 #91772
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 25, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 25, 2024
Roll Flutter from 4ca51a1 to 538e742 (40 revisions)

flutter/flutter@4ca51a1...538e742

2024-09-25 [email protected] Marks Linux build_aar_module_test to be unflaky (flutter/flutter#155349)
2024-09-25 [email protected] Roll Packages from 4926c0f to 7da2374 (3 revisions) (flutter/flutter#155701)
2024-09-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Normalize TabBarTheme (#155476)" (flutter/flutter#155698)
2024-09-25 [email protected] Normalize TabBarTheme (flutter/flutter#155476)
2024-09-25 [email protected] increase both linux & windows tool integration test shards (flutter/flutter#155631)
2024-09-25 [email protected] Roll Flutter Engine from c7cd559e483b to d6d5fdba6ae1 (1 revision) (flutter/flutter#155693)
2024-09-25 [email protected] Add WidgetStateBorderSide example and tests for it. (flutter/flutter#155559)
2024-09-25 [email protected] Roll Flutter Engine from b9dd7a39dd58 to c7cd559e483b (1 revision) (flutter/flutter#155686)
2024-09-25 [email protected] Roll Flutter Engine from 87c1667dfd1e to b9dd7a39dd58 (1 revision) (flutter/flutter#155684)
2024-09-25 [email protected] Roll Flutter Engine from 05211f9d2267 to 87c1667dfd1e (1 revision) (flutter/flutter#155681)
2024-09-25 [email protected] Roll Flutter Engine from 8d1eb7410b49 to 05211f9d2267 (1 revision) (flutter/flutter#155672)
2024-09-25 [email protected] Roll Flutter Engine from ad3dd0df0fe7 to 8d1eb7410b49 (2 revisions) (flutter/flutter#155662)
2024-09-25 [email protected] Roll Flutter Engine from 746ce6124844 to ad3dd0df0fe7 (2 revisions) (flutter/flutter#155653)
2024-09-25 [email protected] Add PrivacyInfo.xcprivacy to macOS plugin template (flutter/flutter#155570)
2024-09-25 [email protected] Roll Flutter Engine from 559f2ff31c74 to 746ce6124844 (14 revisions) (flutter/flutter#155648)
2024-09-25 [email protected] fix `SearchAnchor` disposing `SearchController` while it is still used (flutter/flutter#155219)
2024-09-25 [email protected] Roll pub packages (flutter/flutter#155640)
2024-09-24 [email protected] Preserve transform when using *Gradient:withOpacity (flutter/flutter#154908)
2024-09-24 [email protected] fixed keyboardDismissBehavior on scroll without a drag (flutter/flutter#154675)
2024-09-24 [email protected] Roll Flutter Engine from 7cd3d0b1bb2e to 559f2ff31c74 (3 revisions) (flutter/flutter#155629)
2024-09-24 [email protected] Roll Flutter Engine from 2a13c3a27e1f to 7cd3d0b1bb2e (4 revisions) (flutter/flutter#155625)
2024-09-24 [email protected] Misc docs cleanup and fixes (flutter/flutter#155501)
2024-09-24 [email protected] Roll Flutter Engine from dc44f95b7027 to 2a13c3a27e1f (1 revision) (flutter/flutter#155619)
2024-09-24 [email protected] Roll Flutter Engine from 2745b8797025 to dc44f95b7027 (1 revision) (flutter/flutter#155616)
2024-09-24 [email protected] Roll Flutter Engine from 8a54cc56d4b9 to 2745b8797025 (2 revisions) (flutter/flutter#155610)
2024-09-24 [email protected] Roll Flutter Engine from c07812775255 to 8a54cc56d4b9 (2 revisions) (flutter/flutter#155607)
2024-09-24 [email protected] Roll Packages from 9de72be to 4926c0f (4 revisions) (flutter/flutter#155605)
2024-09-24 [email protected] Fix some broken links in DAP readme (flutter/flutter#155600)
2024-09-24 [email protected] Roll Flutter Engine from 22e4f015cc99 to c07812775255 (2 revisions) (flutter/flutter#155599)
2024-09-24 [email protected] [flutter_tools] Fix encoded stderr in "dart.log" from debug adapter to client (flutter/flutter#155249)
2024-09-24 [email protected] Roll Flutter Engine from 309468cfd1bb to 22e4f015cc99 (2 revisions) (flutter/flutter#155591)
2024-09-24 [email protected] [native assets] Roll dependencies (flutter/flutter#155432)
2024-09-24 [email protected] Roll Flutter Engine from 4013dc28a48b to 309468cfd1bb (2 revisions) (flutter/flutter#155588)
2024-09-24 [email protected] Roll Flutter Engine from 8a5af19a43f3 to 4013dc28a48b (1 revision) (flutter/flutter#155585)
2024-09-24 [email protected] Roll Flutter Engine from 95c5a0940ad9 to 8a5af19a43f3 (10 revisions) (flutter/flutter#155583)
2024-09-24 [email protected] Add `WidgetStateProperty` example and tests for it. (flutter/flutter#155315)
2024-09-24 [email protected] Redo flutter engine flutter autoroll bd3d1990 485b 419c 8c55 b27e3eeb15ed 1727117767 (flutter/flutter#155579)
2024-09-23 [email protected] Roll Flutter Engine from 61f0a3fbabbe to 9bb0ece79ae2 (2 revisions) (flutter/flutter#155549)
2024-09-23 [email protected] Assert macOS framework artifact contains xcprivacy manifest (flutter/flutter#155189)
2024-09-23 [email protected] Roll Packages from f54fe93 to 9de72be (1 revision) (flutter/flutter#155540)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.
...
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 26, 2024
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
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 26, 2024
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
@gaaclarke
Copy link
Member

@QuncCccccc I mentioned this on discord but I know it's easy to get lost so I'll repeat it here:

the way we handled this is to avoid asserting .toString behavior. here's an example:

--- a/dev/tracing_tests/test/timeline_test.dart
+++ b/dev/tracing_tests/test/timeline_test.dart
@@ -108,7 +108,7 @@ void main() {
       <String>['BUILD', 'Placeholder', 'CustomPaint', 'LAYOUT', 'UPDATING COMPOSITING BITS', 'PAINT', 'COMPOSITING', 'FINALIZE TREE'],
     );
     args = (events.where((TimelineEvent event) => event.json!['name'] == '$Placeholder').single.json!['args'] as Map<String, Object?>).cast<String, String>();
-    expect(args['color'], 'Color(0xffffffff)');
+    expect(args['color'], '${const Color(0xffffffff)}');
     debugProfileBuildsEnabled = false;
     debugEnhanceBuildTimelineArguments = false;

thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 26, 2024
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
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 26, 2024
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
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 27, 2024
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
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 27, 2024
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
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 27, 2024
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
thejitenpatel pushed a commit to thejitenpatel/flutter that referenced this pull request Sep 27, 2024
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
QuncCccccc added a commit that referenced this pull request Sep 30, 2024
auto-submit bot pushed a commit that referenced this pull request Oct 1, 2024
Reland #155476 with test fix.

The test fix uses the method mentioned in #155476 (comment).
@QuncCccccc QuncCccccc mentioned this pull request Oct 8, 2024
9 tasks
auto-submit bot pushed a commit that referenced this pull request Oct 8, 2024
Following #155476, this PR is to normalize `ThemeData.tabBarTheme`; change the `TabBarTheme tabBarTheme` property to `TabBarThemeData tabBarTheme` in `ThemeData`. In `ThemeData()` and `ThemeData.copyWith()`, the `tabBarTheme` parameter type is changed to `Object?` to accept both `TabBarTheme` and `TabBarThemeData` so that we won't cause immediate breaking change and make sure rolling is smooth. Once all component themes are normalized, these `Object?` types should be changed to `xxxThemeData`.

There's no way to create a dart fix because we can't add a "@deprecated" label for TabBarTheme; TabBarTheme is a new InheritedWidget subclass now.

Addresses the "theme normalization" sub project within #91772
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants