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
b65a2351
Unverified
Commit
b65a2351
authored
Jan 07, 2021
by
Nathan Walker
Committed by
GitHub
Jan 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SliverAppBar with ShrinkWrap Patch (#73195)
parent
84ddffb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
4 deletions
+47
-4
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+4
-4
viewport_test.dart
packages/flutter/test/rendering/viewport_test.dart
+43
-0
No files found.
packages/flutter/lib/src/rendering/viewport.dart
View file @
b65a2351
...
@@ -2009,19 +2009,19 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
...
@@ -2009,19 +2009,19 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
@override
@override
Iterable
<
RenderSliver
>
get
childrenInPaintOrder
sync
*
{
Iterable
<
RenderSliver
>
get
childrenInPaintOrder
sync
*
{
RenderSliver
?
child
=
fir
stChild
;
RenderSliver
?
child
=
la
stChild
;
while
(
child
!=
null
)
{
while
(
child
!=
null
)
{
yield
child
;
yield
child
;
child
=
child
After
(
child
);
child
=
child
Before
(
child
);
}
}
}
}
@override
@override
Iterable
<
RenderSliver
>
get
childrenInHitTestOrder
sync
*
{
Iterable
<
RenderSliver
>
get
childrenInHitTestOrder
sync
*
{
RenderSliver
?
child
=
la
stChild
;
RenderSliver
?
child
=
fir
stChild
;
while
(
child
!=
null
)
{
while
(
child
!=
null
)
{
yield
child
;
yield
child
;
child
=
child
Before
(
child
);
child
=
child
After
(
child
);
}
}
}
}
}
}
packages/flutter/test/rendering/viewport_test.dart
View file @
b65a2351
...
@@ -1746,6 +1746,49 @@ void main() {
...
@@ -1746,6 +1746,49 @@ void main() {
);
);
});
});
group
(
'Viewport childrenInPaintOrder control test'
,
()
{
test
(
'RenderViewport'
,
()
async
{
final
List
<
RenderSliver
>
children
=
<
RenderSliver
>[
RenderSliverToBoxAdapter
(),
RenderSliverToBoxAdapter
(),
RenderSliverToBoxAdapter
(),
];
final
RenderViewport
renderViewport
=
RenderViewport
(
crossAxisDirection:
AxisDirection
.
right
,
offset:
ViewportOffset
.
zero
(),
children:
children
,
);
// Children should be painted in reverse order to the list given
expect
(
renderViewport
.
childrenInPaintOrder
,
equals
(
children
.
reversed
));
// childrenInPaintOrder should be reverse of childrenInHitTestOrder
expect
(
renderViewport
.
childrenInPaintOrder
,
equals
(
renderViewport
.
childrenInHitTestOrder
.
toList
().
reversed
));
});
test
(
'RenderShrinkWrappingViewport'
,
()
async
{
final
List
<
RenderSliver
>
children
=
<
RenderSliver
>[
RenderSliverToBoxAdapter
(),
RenderSliverToBoxAdapter
(),
RenderSliverToBoxAdapter
(),
];
final
RenderShrinkWrappingViewport
renderViewport
=
RenderShrinkWrappingViewport
(
crossAxisDirection:
AxisDirection
.
right
,
offset:
ViewportOffset
.
zero
(),
children:
children
,
);
// Children should be painted in reverse order to the list given
expect
(
renderViewport
.
childrenInPaintOrder
,
equals
(
children
.
reversed
));
// childrenInPaintOrder should be reverse of childrenInHitTestOrder
expect
(
renderViewport
.
childrenInPaintOrder
,
equals
(
renderViewport
.
childrenInHitTestOrder
.
toList
().
reversed
));
});
});
testWidgets
(
'Handles infinite constraints when TargetPlatform is iOS or macOS'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Handles infinite constraints when TargetPlatform is iOS or macOS'
,
(
WidgetTester
tester
)
async
{
// regression test for https://github.com/flutter/flutter/issues/45866
// regression test for https://github.com/flutter/flutter/issues/45866
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
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