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
a2ce2066
Unverified
Commit
a2ce2066
authored
Jan 27, 2021
by
Pedro Massango
Committed by
GitHub
Jan 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expose clipBehavior (#74046)
parent
4fa250f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
animated_list.dart
packages/flutter/lib/src/widgets/animated_list.dart
+7
-0
animated_list_test.dart
packages/flutter/test/widgets/animated_list_test.dart
+24
-0
No files found.
packages/flutter/lib/src/widgets/animated_list.dart
View file @
a2ce2066
...
...
@@ -276,6 +276,7 @@ class AnimatedList extends StatefulWidget {
this
.
physics
,
this
.
shrinkWrap
=
false
,
this
.
padding
,
this
.
clipBehavior
=
Clip
.
hardEdge
,
})
:
assert
(
itemBuilder
!=
null
),
assert
(
initialItemCount
!=
null
&&
initialItemCount
>=
0
),
super
(
key:
key
);
...
...
@@ -373,6 +374,11 @@ class AnimatedList extends StatefulWidget {
/// The amount of space by which to inset the children.
final
EdgeInsetsGeometry
?
padding
;
/// {@macro flutter.material.Material.clipBehavior}
///
/// Defaults to [Clip.hardEdge].
final
Clip
clipBehavior
;
/// The state from the closest instance of this class that encloses the given
/// context.
///
...
...
@@ -493,6 +499,7 @@ class AnimatedListState extends State<AnimatedList> with TickerProviderStateMixi
primary:
widget
.
primary
,
physics:
widget
.
physics
,
shrinkWrap:
widget
.
shrinkWrap
,
clipBehavior:
widget
.
clipBehavior
,
slivers:
<
Widget
>[
SliverPadding
(
padding:
widget
.
padding
??
EdgeInsets
.
zero
,
...
...
packages/flutter/test/widgets/animated_list_test.dart
View file @
a2ce2066
...
...
@@ -363,4 +363,28 @@ void main() {
),
);
});
testWidgets
(
'AnimatedList.clipBehavior is forwarded to its inner CustomScrollView'
,
(
WidgetTester
tester
)
async
{
const
Clip
clipBehavior
=
Clip
.
none
;
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
AnimatedList
(
initialItemCount:
2
,
clipBehavior:
clipBehavior
,
itemBuilder:
(
BuildContext
context
,
int
index
,
Animation
<
double
>
_
)
{
return
SizedBox
(
height:
100.0
,
child:
Center
(
child:
Text
(
'item
$index
'
),
),
);
},
),
),
);
expect
(
tester
.
widget
<
CustomScrollView
>(
find
.
byType
(
CustomScrollView
)).
clipBehavior
,
clipBehavior
);
});
}
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