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
c7e2e8ae
Commit
c7e2e8ae
authored
Apr 19, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Scaffold scrollableKey use in gallery demos (#3406)
* Remove Scaffold scrollable_key demo usage
parent
6e0c76f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
9 deletions
+4
-9
flexible_space_demo.dart
examples/material_gallery/lib/demo/flexible_space_demo.dart
+0
-3
tabs_demo.dart
examples/material_gallery/lib/demo/tabs_demo.dart
+0
-1
home.dart
examples/material_gallery/lib/gallery/home.dart
+0
-3
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+4
-2
No files found.
examples/material_gallery/lib/demo/flexible_space_demo.dart
View file @
c7e2e8ae
...
...
@@ -77,7 +77,6 @@ class FlexibleSpaceDemo extends StatefulWidget {
class
FlexibleSpaceDemoState
extends
State
<
FlexibleSpaceDemo
>
{
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
final
double
_appBarHeight
=
256.0
;
final
Key
_scrollableKey
=
new
UniqueKey
();
AppBarBehavior
_appBarBehavior
=
AppBarBehavior
.
scroll
;
@override
...
...
@@ -90,7 +89,6 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
),
child:
new
Scaffold
(
key:
_scaffoldKey
,
scrollableKey:
_scrollableKey
,
appBarBehavior:
_appBarBehavior
,
appBar:
new
AppBar
(
expandedHeight:
_appBarHeight
,
...
...
@@ -132,7 +130,6 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
)
),
body:
new
Block
(
scrollableKey:
_scrollableKey
,
padding:
new
EdgeInsets
.
only
(
top:
_appBarHeight
+
statusBarHeight
),
children:
<
Widget
>[
new
_ContactCategory
(
...
...
examples/material_gallery/lib/demo/tabs_demo.dart
View file @
c7e2e8ae
...
...
@@ -45,7 +45,6 @@ class TabsDemoState extends State<TabsDemo> {
});
},
child:
new
Scaffold
(
scrollableKey:
_selectedPage
.
key
,
appBarBehavior:
AppBarBehavior
.
under
,
appBar:
new
AppBar
(
title:
new
Text
(
'Tabs and scrolling'
),
...
...
examples/material_gallery/lib/gallery/home.dart
View file @
c7e2e8ae
...
...
@@ -75,7 +75,6 @@ class GalleryHome extends StatefulWidget {
class
GalleryHomeState
extends
State
<
GalleryHome
>
{
final
Key
_homeKey
=
new
ValueKey
<
String
>(
"Gallery Home"
);
final
Key
_listKey
=
new
ValueKey
<
String
>(
"Gallery List"
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -98,12 +97,10 @@ class GalleryHomeState extends State<GalleryHome> {
background:
new
GalleryHeader
()
)
),
scrollableKey:
_listKey
,
appBarBehavior:
AppBarBehavior
.
under
,
body:
new
TwoLevelList
(
padding:
new
EdgeInsets
.
only
(
top:
_kFlexibleSpaceMaxHeight
+
statusBarHight
),
type:
MaterialListType
.
oneLine
,
scrollableKey:
_listKey
,
children:
<
Widget
>[
new
TwoLevelSublist
(
leading:
new
Icon
(
icon:
Icons
.
star
),
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
c7e2e8ae
...
...
@@ -487,8 +487,10 @@ class ScaffoldState extends State<Scaffold> {
double
_floatingAppBarHeight
=
0.0
;
bool
_handleScrollNotification
(
ScrollNotification
notification
)
{
if
(
config
.
scrollableKey
==
null
||
config
.
scrollableKey
==
notification
.
scrollable
.
config
.
key
)
{
final
double
newScrollOffset
=
notification
.
scrollable
.
scrollOffset
;
final
ScrollableState
scrollable
=
notification
.
scrollable
;
if
((
scrollable
.
config
.
scrollDirection
==
Axis
.
vertical
)
&&
(
config
.
scrollableKey
==
null
||
config
.
scrollableKey
==
scrollable
.
config
.
key
))
{
final
double
newScrollOffset
=
scrollable
.
scrollOffset
;
setState
(()
{
_scrollOffsetDelta
=
_scrollOffset
-
newScrollOffset
;
_scrollOffset
=
newScrollOffset
;
...
...
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