Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
ce51e71d
Unverified
Commit
ce51e71d
authored
Aug 30, 2018
by
Hans Muller
Committed by
GitHub
Aug 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Card clipBehavior pass-through property (#21187)
parent
ec5c2e3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
card.dart
packages/flutter/lib/src/material/card.dart
+7
-0
card_test.dart
packages/flutter/test/material/card_test.dart
+7
-0
No files found.
packages/flutter/lib/src/material/card.dart
View file @
ce51e71d
...
...
@@ -60,12 +60,15 @@ import 'theme.dart';
/// * <https://material.google.com/components/cards.html>
class
Card
extends
StatelessWidget
{
/// Creates a material design card.
///
/// The [clipBehavior] argument must not be null.
const
Card
({
Key
key
,
this
.
color
,
this
.
elevation
,
this
.
shape
,
this
.
margin
=
const
EdgeInsets
.
all
(
4.0
),
this
.
clipBehavior
=
Clip
.
none
,
this
.
child
,
this
.
semanticContainer
=
true
,
})
:
super
(
key:
key
);
...
...
@@ -93,6 +96,9 @@ class Card extends StatelessWidget {
/// radius of 4.0.
final
ShapeBorder
shape
;
/// {@macro flutter.widgets.Clip}
final
Clip
clipBehavior
;
/// The empty space that surrounds the card.
///
/// Defines the card's outer [Container.margin].
...
...
@@ -133,6 +139,7 @@ class Card extends StatelessWidget {
shape:
shape
??
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4.0
)),
),
clipBehavior:
clipBehavior
,
child:
child
,
),
),
...
...
packages/flutter/test/material/card_test.dart
View file @
ce51e71d
...
...
@@ -157,4 +157,11 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byKey
(
contentsKey
)),
const
Size
(
100.0
,
100.0
));
});
testWidgets
(
'Card clipBehavior property passes through to the Material'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
Card
());
expect
(
tester
.
widget
<
Material
>(
find
.
byType
(
Material
)).
clipBehavior
,
Clip
.
none
);
await
tester
.
pumpWidget
(
const
Card
(
clipBehavior:
Clip
.
antiAlias
));
expect
(
tester
.
widget
<
Material
>(
find
.
byType
(
Material
)).
clipBehavior
,
Clip
.
antiAlias
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment