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
337290e6
Unverified
Commit
337290e6
authored
Dec 29, 2020
by
xubaolin
Committed by
GitHub
Dec 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a RenderSliverFixedExtentBoxAdaptor Exception (#72922)
parent
38fe7e2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
sliver_fixed_extent_list.dart
...s/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
+1
-1
list_view_builder_test.dart
packages/flutter/test/widgets/list_view_builder_test.dart
+23
-0
No files found.
packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
View file @
337290e6
...
...
@@ -195,7 +195,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
if
(
firstChild
!=
null
)
{
final
int
leadingGarbage
=
_calculateLeadingGarbage
(
firstIndex
);
final
int
trailingGarbage
=
_calculateTrailingGarbage
(
targetLastIndex
!)
;
final
int
trailingGarbage
=
targetLastIndex
!=
null
?
_calculateTrailingGarbage
(
targetLastIndex
)
:
0
;
collectGarbage
(
leadingGarbage
,
trailingGarbage
);
}
else
{
collectGarbage
(
0
,
0
);
...
...
packages/flutter/test/widgets/list_view_builder_test.dart
View file @
337290e6
...
...
@@ -352,6 +352,29 @@ void main() {
await
tester
.
pumpWidget
(
buildFrame
(
itemCount:
4
));
expect
(
scrollable
().
semanticChildCount
,
4
);
});
// Regression test for https://github.com/flutter/flutter/issues/72292
testWidgets
(
'ListView.builder and SingleChildScrollView can work well together'
,
(
WidgetTester
tester
)
async
{
Widget
builder
(
int
itemCount
)
{
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SingleChildScrollView
(
child:
ListView
.
builder
(
shrinkWrap:
true
,
itemExtent:
35
,
itemCount:
itemCount
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
const
Text
(
'I love Flutter.'
);
},
),
),
);
}
await
tester
.
pumpWidget
(
builder
(
1
));
// Trigger relayout and garbage collect.
await
tester
.
pumpWidget
(
builder
(
2
));
});
}
void
check
(
{
List
<
int
>
visible
=
const
<
int
>[],
List
<
int
>
hidden
=
const
<
int
>[]
})
{
...
...
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