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
64f42c0e
Unverified
Commit
64f42c0e
authored
Jun 12, 2020
by
Kate Lovett
Committed by
GitHub
Jun 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support floating the header slivers of a NestedScrollView (#59187)
parent
e96b13c7
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
923 additions
and
119 deletions
+923
-119
sliver_persistent_header.dart
...s/flutter/lib/src/rendering/sliver_persistent_header.dart
+1
-1
nested_scroll_view.dart
packages/flutter/lib/src/widgets/nested_scroll_view.dart
+326
-118
sliver_persistent_header_test.dart
...flutter/test/rendering/sliver_persistent_header_test.dart
+30
-0
nested_scroll_view_test.dart
packages/flutter/test/widgets/nested_scroll_view_test.dart
+566
-0
No files found.
packages/flutter/lib/src/rendering/sliver_persistent_header.dart
View file @
64f42c0e
...
...
@@ -644,7 +644,7 @@ abstract class RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFl
paintExtent:
clampedPaintExtent
,
layoutExtent:
layoutExtent
.
clamp
(
0.0
,
clampedPaintExtent
)
as
double
,
maxPaintExtent:
maxExtent
+
stretchOffset
,
maxScrollObstructionExtent:
m
ax
Extent
,
maxScrollObstructionExtent:
m
in
Extent
,
hasVisualOverflow:
true
,
// Conservatively say we do have overflow to avoid complexity.
);
return
0.0
;
...
...
packages/flutter/lib/src/widgets/nested_scroll_view.dart
View file @
64f42c0e
This diff is collapsed.
Click to expand it.
packages/flutter/test/rendering/sliver_persistent_header_test.dart
View file @
64f42c0e
...
...
@@ -26,6 +26,24 @@ void main() {
expect
(
header
.
geometry
.
maxScrollObstructionExtent
,
0
);
});
test
(
'RenderSliverFloatingPinnedPersistentHeader maxScrollObstructionExtent is minExtent'
,
()
{
final
TestRenderSliverFloatingPinnedPersistentHeader
header
=
TestRenderSliverFloatingPinnedPersistentHeader
(
child:
RenderSizedBox
(
const
Size
(
400.0
,
100.0
)
));
final
RenderViewport
root
=
RenderViewport
(
axisDirection:
AxisDirection
.
down
,
crossAxisDirection:
AxisDirection
.
right
,
offset:
ViewportOffset
.
zero
(),
cacheExtent:
0
,
children:
<
RenderSliver
>[
header
,
],
);
layout
(
root
);
expect
(
header
.
geometry
.
maxScrollObstructionExtent
,
100.0
);
});
}
class
TestRenderSliverFloatingPersistentHeader
extends
RenderSliverFloatingPersistentHeader
{
...
...
@@ -39,3 +57,15 @@ class TestRenderSliverFloatingPersistentHeader extends RenderSliverFloatingPersi
@override
double
get
minExtent
=>
100
;
}
class
TestRenderSliverFloatingPinnedPersistentHeader
extends
RenderSliverFloatingPinnedPersistentHeader
{
TestRenderSliverFloatingPinnedPersistentHeader
({
RenderBox
child
,
})
:
super
(
child:
child
);
@override
double
get
maxExtent
=>
200
;
@override
double
get
minExtent
=>
100
;
}
packages/flutter/test/widgets/nested_scroll_view_test.dart
View file @
64f42c0e
This diff is collapsed.
Click to expand it.
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