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
4ad3d99b
Unverified
Commit
4ad3d99b
authored
Jan 07, 2019
by
Hans Muller
Committed by
GitHub
Jan 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a floating snapping SliverAppBar crash (#26101)
parent
cb6fec10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
sliver_persistent_header.dart
...s/flutter/lib/src/rendering/sliver_persistent_header.dart
+1
-0
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+63
-0
No files found.
packages/flutter/lib/src/rendering/sliver_persistent_header.dart
View file @
4ad3d99b
...
...
@@ -393,6 +393,7 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste
return
;
if
(
value
==
null
)
{
_controller
?.
dispose
();
_controller
=
null
;
}
else
{
if
(
_snapConfiguration
!=
null
&&
value
.
vsync
!=
_snapConfiguration
.
vsync
)
_controller
?.
resync
(
value
.
vsync
);
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
4ad3d99b
...
...
@@ -1422,4 +1422,67 @@ void main() {
statusBarIconBrightness:
Brightness
.
dark
,
));
});
testWidgets
(
'Changing SliverAppBar snap from true to false'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/17598
const
double
appBarHeight
=
256.0
;
bool
snap
=
true
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
return
Scaffold
(
body:
CustomScrollView
(
slivers:
<
Widget
>[
SliverAppBar
(
expandedHeight:
appBarHeight
,
pinned:
false
,
floating:
true
,
snap:
snap
,
actions:
<
Widget
>[
FlatButton
(
child:
const
Text
(
'snap=false'
),
onPressed:
()
{
setState
(()
{
snap
=
false
;
});
},
),
],
flexibleSpace:
FlexibleSpaceBar
(
background:
Container
(
height:
appBarHeight
,
color:
Colors
.
orange
,
),
),
),
SliverList
(
delegate:
SliverChildListDelegate
(
<
Widget
>[
Container
(
height:
1200.0
,
color:
Colors
.
teal
),
],
),
),
],
),
);
},
),
),
);
TestGesture
gesture
=
await
tester
.
startGesture
(
const
Offset
(
50.0
,
400.0
));
await
gesture
.
moveBy
(
const
Offset
(
0.0
,
-
100.0
));
await
gesture
.
up
();
await
tester
.
tap
(
find
.
text
(
'snap=false'
));
await
tester
.
pumpAndSettle
();
gesture
=
await
tester
.
startGesture
(
const
Offset
(
50.0
,
400.0
));
await
gesture
.
moveBy
(
const
Offset
(
0.0
,
-
100.0
));
await
gesture
.
up
();
await
tester
.
pump
();
});
}
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