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
2a5e528a
Commit
2a5e528a
authored
Dec 03, 2019
by
Kate Lovett
Committed by
Flutter GitHub Bot
Dec 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing SliverOverlapAbsorber & SliverOverlapInjector child property (#44283)
parent
b63683b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
12 deletions
+33
-12
picture_cache.dart
dev/benchmarks/macrobenchmarks/lib/src/picture_cache.dart
+1
-1
tabs_demo.dart
examples/flutter_gallery/lib/demo/material/tabs_demo.dart
+1
-1
nested_scroll_view.dart
packages/flutter/lib/src/widgets/nested_scroll_view.dart
+30
-9
nested_scroll_view_test.dart
packages/flutter/test/widgets/nested_scroll_view_test.dart
+1
-1
No files found.
dev/benchmarks/macrobenchmarks/lib/src/picture_cache.dart
View file @
2a5e528a
...
...
@@ -20,7 +20,7 @@ class PictureCachePage extends StatelessWidget {
return
<
Widget
>[
SliverOverlapAbsorber
(
handle:
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
child
:
SliverAppBar
(
sliver
:
SliverAppBar
(
title:
const
Text
(
'Picture Cache'
),
pinned:
true
,
expandedHeight:
50.0
,
...
...
examples/flutter_gallery/lib/demo/material/tabs_demo.dart
View file @
2a5e528a
...
...
@@ -150,7 +150,7 @@ class TabsDemo extends StatelessWidget {
return
<
Widget
>[
SliverOverlapAbsorber
(
handle:
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
child
:
SliverAppBar
(
sliver
:
SliverAppBar
(
title:
const
Text
(
'Tabs and scrolling'
),
actions:
<
Widget
>[
MaterialDemoDocumentationButton
(
routeName
)],
pinned:
true
,
...
...
packages/flutter/lib/src/widgets/nested_scroll_view.dart
View file @
2a5e528a
...
...
@@ -91,7 +91,7 @@ typedef NestedScrollViewHeaderSliversBuilder = List<Widget> Function(BuildContex
/// // This is not necessary if the "headerSliverBuilder" only builds
/// // widgets that do not overlap the next sliver.
/// handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
///
child
: SliverAppBar(
///
sliver
: SliverAppBar(
/// title: const Text('Books'), // This is the title in the app bar.
/// pinned: true,
/// expandedHeight: 150.0,
...
...
@@ -1317,7 +1317,7 @@ class SliverOverlapAbsorberHandle extends ChangeNotifier {
/// A sliver that wraps another, forcing its layout extent to be treated as
/// overlap.
///
/// The difference between the overlap requested by the
[child] sliver
and the
/// The difference between the overlap requested by the
child [sliver]
and the
/// overlap reported by this widget, called the _absorbed overlap_, is reported
/// to the [SliverOverlapAbsorberHandle], which is typically passed to a
/// [SliverOverlapInjector].
...
...
@@ -1331,14 +1331,20 @@ class SliverOverlapAbsorber extends SingleChildRenderObjectWidget {
/// [SliverOverlapAbsorberHandle].
///
/// The [handle] must not be null.
///
/// The [child] must be a sliver.
const
SliverOverlapAbsorber
({
Key
key
,
@required
this
.
handle
,
@Deprecated
(
'Use sliver instead. '
'This feature was deprecated after v1.10.16.'
)
Widget
child
,
Widget
sliver
,
})
:
assert
(
handle
!=
null
),
super
(
key:
key
,
child:
child
);
// ignore: deprecated_member_use_from_same_package
assert
(
child
==
null
||
sliver
==
null
),
// ignore: deprecated_member_use_from_same_package
super
(
key:
key
,
child:
sliver
??
child
);
/// The object in which the absorbed overlap is recorded.
///
...
...
@@ -1369,7 +1375,7 @@ class SliverOverlapAbsorber extends SingleChildRenderObjectWidget {
/// A sliver that wraps another, forcing its layout extent to be treated as
/// overlap.
///
/// The difference between the overlap requested by the
[child] sliver
and the
/// The difference between the overlap requested by the
child [sliver]
and the
/// overlap reported by this widget, called the _absorbed overlap_, is reported
/// to the [SliverOverlapAbsorberHandle], which is typically passed to a
/// [RenderSliverOverlapInjector].
...
...
@@ -1379,13 +1385,20 @@ class RenderSliverOverlapAbsorber extends RenderSliver with RenderObjectWithChil
///
/// The [handle] must not be null.
///
/// The [
child
] must be a [RenderSliver].
/// The [
sliver
] must be a [RenderSliver].
RenderSliverOverlapAbsorber
({
@required
SliverOverlapAbsorberHandle
handle
,
@Deprecated
(
'Use sliver instead. '
'This feature was deprecated after v1.10.16.'
)
RenderSliver
child
,
RenderSliver
sliver
,
})
:
assert
(
handle
!=
null
),
// ignore: deprecated_member_use_from_same_package
assert
(
child
==
null
||
sliver
==
null
),
_handle
=
handle
{
this
.
child
=
child
;
this
.
child
=
sliver
??
child
;
}
/// The object in which the absorbed overlap is recorded.
...
...
@@ -1486,9 +1499,17 @@ class SliverOverlapInjector extends SingleChildRenderObjectWidget {
const
SliverOverlapInjector
({
Key
key
,
@required
this
.
handle
,
@Deprecated
(
'Use sliver instead. '
'This feature was deprecated after v1.10.16.'
)
Widget
child
,
Widget
sliver
,
})
:
assert
(
handle
!=
null
),
super
(
key:
key
,
child:
child
);
// ignore: deprecated_member_use_from_same_package
assert
(
child
==
null
||
sliver
==
null
),
// ignore: deprecated_member_use_from_same_package
super
(
key:
key
,
child:
sliver
??
child
);
/// The handle to the [SliverOverlapAbsorber] that is feeding this injector.
///
...
...
packages/flutter/test/widgets/nested_scroll_view_test.dart
View file @
2a5e528a
...
...
@@ -379,7 +379,7 @@ void main() {
// This is not necessary if the "headerSliverBuilder" only builds
// widgets that do not overlap the next sliver.
handle:
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
child
:
SliverAppBar
(
sliver
:
SliverAppBar
(
title:
const
Text
(
'Books'
),
// This is the title in the app bar.
pinned:
true
,
expandedHeight:
150.0
,
...
...
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