Skip to content

Commit

Permalink
Improve documentation of CardTheme.shape (#139096)
Browse files Browse the repository at this point in the history
The previous documentation did not point out the difference between the default corner radius for Material 2 and Material 3.

Fixes: flutter/flutter#139093
  • Loading branch information
dumazy authored Nov 29, 2023
1 parent 5e216d4 commit 1d4d002
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/flutter/lib/src/material/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ class Card extends StatelessWidget {
///
/// If this property is null then [CardTheme.shape] of [ThemeData.cardTheme]
/// is used. If that's null then the shape will be a [RoundedRectangleBorder]
/// with a circular corner radius of 4.0.
/// with a circular corner radius of 12.0 and if [ThemeData.useMaterial3] is
/// false, then the circular corner radius will be 4.0.
final ShapeBorder? shape;

/// Whether to paint the [shape] border in front of the [child].
Expand Down
3 changes: 2 additions & 1 deletion packages/flutter/lib/src/material/card_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class CardTheme with Diagnosticable {
/// Overrides the default value for [Card.shape].
///
/// If null, [Card] then uses a [RoundedRectangleBorder] with a circular
/// corner radius of 4.0.
/// corner radius of 12.0 and if [ThemeData.useMaterial3] is false,
/// then the circular corner radius will be 4.0.
final ShapeBorder? shape;

/// Creates a copy of this object with the given fields replaced with the
Expand Down

0 comments on commit 1d4d002

Please sign in to comment.