New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CircleAvatar
to support Material 3
#114812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, just needs one small change.
Color? effectiveBackgroundColor = backgroundColor; | ||
final Color? effectiveForegroundColor = foregroundColor | ||
?? (theme.useMaterial3 ? theme.colorScheme.onPrimaryContainer : null); | ||
TextStyle textStyle = theme.primaryTextTheme.titleMedium!.copyWith(color: effectiveForegroundColor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using theme.textTheme
here. primaryTextTheme, like primaryColorLight and primaryColorDark, are obsolete and will be deprecated when Material3 becomes the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -306,6 +278,61 @@ void main() { | |||
final RenderParagraph paragraph = tester.renderObject(find.text('Z')); | |||
expect(paragraph.text.style!.color, equals(ThemeData.fallback().primaryColorLight)); | |||
}); | |||
|
|||
group('Material 2', () { | |||
// Tests that are only relevant for Material 2. Once ThemeData.useMaterial3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE
6646f89
to
0e17b23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* a84e369bd Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902) * 1725a26e2 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834) * 7020f59ac [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048) * 9797d5f1c [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645) * 530324d23 Build command dependency injection (flutter/flutter#114383) * 69a542dad Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660) * 92f10ed71 match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922) * d3dcd7d53 Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902) * 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834) * 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048) * 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645) * 530324d Build command dependency injection (flutter/flutter#114383) * 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660) * 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922) * d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902) * 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834) * 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048) * 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645) * 530324d Build command dependency injection (flutter/flutter#114383) * 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660) * 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922) * d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
…#2791) * a84e369bd Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902) * 1725a26e2 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834) * 7020f59ac [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048) * 9797d5f1c [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645) * 530324d23 Build command dependency injection (flutter/flutter#114383) * 69a542dad Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660) * 92f10ed71 match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922) * d3dcd7d53 Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902) * 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834) * 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048) * 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645) * 530324d Build command dependency injection (flutter/flutter#114383) * 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660) * 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922) * d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902) * 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834) * 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048) * 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645) * 530324d Build command dependency injection (flutter/flutter#114383) * 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660) * 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922) * d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
fixes #114811
This PR updates
CircleAvatar
to support Material 3.Since there is no theme for the
CircleAvatar
, I just updated the default colors.M3 Avatar size and font are the same as the current one.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.