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
e05dcc9c
Commit
e05dcc9c
authored
Nov 30, 2016
by
Hans Muller
Committed by
GitHub
Nov 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extraneous gallery demo scrollable keys (#7098)
parent
60b19b20
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
0 additions
and
56 deletions
+0
-56
cards_demo.dart
examples/flutter_gallery/lib/demo/cards_demo.dart
+0
-3
colors_demo.dart
examples/flutter_gallery/lib/demo/colors_demo.dart
+0
-17
grid_list_demo.dart
examples/flutter_gallery/lib/demo/grid_list_demo.dart
+0
-3
leave_behind_demo.dart
examples/flutter_gallery/lib/demo/leave_behind_demo.dart
+0
-3
list_demo.dart
examples/flutter_gallery/lib/demo/list_demo.dart
+0
-3
overscroll_demo.dart
examples/flutter_gallery/lib/demo/overscroll_demo.dart
+0
-1
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+0
-3
shrine_order.dart
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
+0
-4
shrine_page.dart
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
+0
-3
tabs_demo.dart
examples/flutter_gallery/lib/demo/tabs_demo.dart
+0
-16
No files found.
examples/flutter_gallery/lib/demo/cards_demo.dart
View file @
e05dcc9c
...
@@ -126,18 +126,15 @@ class TravelDestinationItem extends StatelessWidget {
...
@@ -126,18 +126,15 @@ class TravelDestinationItem extends StatelessWidget {
}
}
class
CardsDemo
extends
StatelessWidget
{
class
CardsDemo
extends
StatelessWidget
{
static
final
GlobalKey
<
ScrollableState
>
_scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
static
const
String
routeName
=
'/cards'
;
static
const
String
routeName
=
'/cards'
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
return
new
Scaffold
(
scrollableKey:
_scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
new
Text
(
'Travel stream'
)
title:
new
Text
(
'Travel stream'
)
),
),
body:
new
ScrollableList
(
body:
new
ScrollableList
(
scrollableKey:
_scrollableKey
,
itemExtent:
TravelDestinationItem
.
height
,
itemExtent:
TravelDestinationItem
.
height
,
padding:
const
EdgeInsets
.
only
(
top:
8.0
,
left:
8.0
,
right:
8.0
),
padding:
const
EdgeInsets
.
only
(
top:
8.0
,
left:
8.0
,
right:
8.0
),
children:
destinations
.
map
((
TravelDestination
destination
)
{
children:
destinations
.
map
((
TravelDestination
destination
)
{
...
...
examples/flutter_gallery/lib/demo/colors_demo.dart
View file @
e05dcc9c
...
@@ -9,7 +9,6 @@ const double kColorItemHeight = 48.0;
...
@@ -9,7 +9,6 @@ const double kColorItemHeight = 48.0;
class
ColorSwatch
{
class
ColorSwatch
{
ColorSwatch
({
this
.
name
,
this
.
colors
,
this
.
accentColors
,
this
.
threshold
:
900
});
ColorSwatch
({
this
.
name
,
this
.
colors
,
this
.
accentColors
,
this
.
threshold
:
900
});
final
GlobalKey
<
ScrollableState
>
scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
final
String
name
;
final
String
name
;
final
Map
<
int
,
Color
>
colors
;
final
Map
<
int
,
Color
>
colors
;
final
Map
<
int
,
Color
>
accentColors
;
final
Map
<
int
,
Color
>
accentColors
;
...
@@ -102,7 +101,6 @@ class ColorSwatchTabView extends StatelessWidget {
...
@@ -102,7 +101,6 @@ class ColorSwatchTabView extends StatelessWidget {
}
}
return
new
ScrollableList
(
return
new
ScrollableList
(
scrollableKey:
swatch
.
scrollableKey
,
itemExtent:
kColorItemHeight
,
itemExtent:
kColorItemHeight
,
children:
colorItems
children:
colorItems
);
);
...
@@ -119,26 +117,11 @@ class ColorsDemo extends StatefulWidget {
...
@@ -119,26 +117,11 @@ class ColorsDemo extends StatefulWidget {
}
}
class
_ColorsDemoState
extends
State
<
ColorsDemo
>
{
class
_ColorsDemoState
extends
State
<
ColorsDemo
>
{
ColorSwatch
_selectedSwatch
;
@override
void
initState
()
{
super
.
initState
();
_selectedSwatch
=
colorSwatches
.
first
;
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
new
TabBarSelection
<
ColorSwatch
>(
return
new
TabBarSelection
<
ColorSwatch
>(
values:
colorSwatches
,
values:
colorSwatches
,
onChanged:
(
ColorSwatch
value
)
{
setState
(()
{
_selectedSwatch
=
value
;
});
},
child:
new
Scaffold
(
child:
new
Scaffold
(
scrollableKey:
_selectedSwatch
.
scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
elevation:
0
,
elevation:
0
,
title:
new
Text
(
'Colors'
),
title:
new
Text
(
'Colors'
),
...
...
examples/flutter_gallery/lib/demo/grid_list_demo.dart
View file @
e05dcc9c
...
@@ -239,7 +239,6 @@ class GridListDemo extends StatefulWidget {
...
@@ -239,7 +239,6 @@ class GridListDemo extends StatefulWidget {
}
}
class
GridListDemoState
extends
State
<
GridListDemo
>
{
class
GridListDemoState
extends
State
<
GridListDemo
>
{
static
final
GlobalKey
<
ScrollableState
>
_scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
GridDemoTileStyle
_tileStyle
=
GridDemoTileStyle
.
twoLine
;
GridDemoTileStyle
_tileStyle
=
GridDemoTileStyle
.
twoLine
;
List
<
Photo
>
photos
=
<
Photo
>[
List
<
Photo
>
photos
=
<
Photo
>[
...
@@ -318,7 +317,6 @@ class GridListDemoState extends State<GridListDemo> {
...
@@ -318,7 +317,6 @@ class GridListDemoState extends State<GridListDemo> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
Orientation
orientation
=
MediaQuery
.
of
(
context
).
orientation
;
final
Orientation
orientation
=
MediaQuery
.
of
(
context
).
orientation
;
return
new
Scaffold
(
return
new
Scaffold
(
scrollableKey:
_scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
new
Text
(
'Grid list'
),
title:
new
Text
(
'Grid list'
),
actions:
<
Widget
>[
actions:
<
Widget
>[
...
@@ -345,7 +343,6 @@ class GridListDemoState extends State<GridListDemo> {
...
@@ -345,7 +343,6 @@ class GridListDemoState extends State<GridListDemo> {
children:
<
Widget
>[
children:
<
Widget
>[
new
Expanded
(
new
Expanded
(
child:
new
ScrollableGrid
(
child:
new
ScrollableGrid
(
scrollableKey:
_scrollableKey
,
delegate:
new
FixedColumnCountGridDelegate
(
delegate:
new
FixedColumnCountGridDelegate
(
columnCount:
(
orientation
==
Orientation
.
portrait
)
?
2
:
3
,
columnCount:
(
orientation
==
Orientation
.
portrait
)
?
2
:
3
,
rowSpacing:
4.0
,
rowSpacing:
4.0
,
...
...
examples/flutter_gallery/lib/demo/leave_behind_demo.dart
View file @
e05dcc9c
...
@@ -39,7 +39,6 @@ class LeaveBehindDemo extends StatefulWidget {
...
@@ -39,7 +39,6 @@ class LeaveBehindDemo extends StatefulWidget {
class
LeaveBehindDemoState
extends
State
<
LeaveBehindDemo
>
{
class
LeaveBehindDemoState
extends
State
<
LeaveBehindDemo
>
{
static
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
static
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
static
final
GlobalKey
<
ScrollableState
>
_scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
DismissDirection
_dismissDirection
=
DismissDirection
.
horizontal
;
DismissDirection
_dismissDirection
=
DismissDirection
.
horizontal
;
List
<
LeaveBehindItem
>
leaveBehindItems
;
List
<
LeaveBehindItem
>
leaveBehindItems
;
...
@@ -132,7 +131,6 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
...
@@ -132,7 +131,6 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
return
new
Scaffold
(
key:
_scaffoldKey
,
key:
_scaffoldKey
,
scrollableKey:
_scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
new
Text
(
'Swipe to dismiss'
),
title:
new
Text
(
'Swipe to dismiss'
),
actions:
<
Widget
>[
actions:
<
Widget
>[
...
@@ -164,7 +162,6 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
...
@@ -164,7 +162,6 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
]
]
),
),
body:
new
Block
(
body:
new
Block
(
scrollableKey:
_scrollableKey
,
children:
leaveBehindItems
.
map
(
buildItem
).
toList
()
children:
leaveBehindItems
.
map
(
buildItem
).
toList
()
)
)
);
);
...
...
examples/flutter_gallery/lib/demo/list_demo.dart
View file @
e05dcc9c
...
@@ -15,7 +15,6 @@ class ListDemo extends StatefulWidget {
...
@@ -15,7 +15,6 @@ class ListDemo extends StatefulWidget {
class
ListDemoState
extends
State
<
ListDemo
>
{
class
ListDemoState
extends
State
<
ListDemo
>
{
static
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
static
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
static
final
GlobalKey
<
ScrollableState
>
_scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
PersistentBottomSheetController
<
Null
>
_bottomSheet
;
PersistentBottomSheetController
<
Null
>
_bottomSheet
;
MaterialListType
_itemType
=
MaterialListType
.
threeLine
;
MaterialListType
_itemType
=
MaterialListType
.
threeLine
;
...
@@ -172,7 +171,6 @@ class ListDemoState extends State<ListDemo> {
...
@@ -172,7 +171,6 @@ class ListDemoState extends State<ListDemo> {
return
new
Scaffold
(
return
new
Scaffold
(
key:
scaffoldKey
,
key:
scaffoldKey
,
scrollableKey:
_scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
new
Text
(
'Scrolling list
\n
$itemTypeText$layoutText
'
),
title:
new
Text
(
'Scrolling list
\n
$itemTypeText$layoutText
'
),
actions:
<
Widget
>[
actions:
<
Widget
>[
...
@@ -195,7 +193,6 @@ class ListDemoState extends State<ListDemo> {
...
@@ -195,7 +193,6 @@ class ListDemoState extends State<ListDemo> {
),
),
body:
new
Scrollbar
(
body:
new
Scrollbar
(
child:
new
MaterialList
(
child:
new
MaterialList
(
scrollableKey:
_scrollableKey
,
type:
_itemType
,
type:
_itemType
,
padding:
new
EdgeInsets
.
symmetric
(
vertical:
_dense
?
4.0
:
8.0
),
padding:
new
EdgeInsets
.
symmetric
(
vertical:
_dense
?
4.0
:
8.0
),
children:
listItems
children:
listItems
...
...
examples/flutter_gallery/lib/demo/overscroll_demo.dart
View file @
e05dcc9c
...
@@ -78,7 +78,6 @@ class OverscrollDemoState extends State<OverscrollDemo> {
...
@@ -78,7 +78,6 @@ class OverscrollDemoState extends State<OverscrollDemo> {
return
new
Scaffold
(
return
new
Scaffold
(
key:
_scaffoldKey
,
key:
_scaffoldKey
,
scrollableKey:
_scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
new
Text
(
'
$indicatorTypeText
'
),
title:
new
Text
(
'
$indicatorTypeText
'
),
actions:
<
Widget
>[
actions:
<
Widget
>[
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
e05dcc9c
...
@@ -293,7 +293,6 @@ class ShrineHome extends StatefulWidget {
...
@@ -293,7 +293,6 @@ class ShrineHome extends StatefulWidget {
class
_ShrineHomeState
extends
State
<
ShrineHome
>
{
class
_ShrineHomeState
extends
State
<
ShrineHome
>
{
static
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>(
debugLabel:
'Shrine Home'
);
static
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>(
debugLabel:
'Shrine Home'
);
static
final
GlobalKey
<
ScrollableState
>
scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
static
final
GridDelegate
gridDelegate
=
new
ShrineGridDelegate
();
static
final
GridDelegate
gridDelegate
=
new
ShrineGridDelegate
();
Future
<
Null
>
showOrderPage
(
Product
product
)
async
{
Future
<
Null
>
showOrderPage
(
Product
product
)
async
{
...
@@ -318,11 +317,9 @@ class _ShrineHomeState extends State<ShrineHome> {
...
@@ -318,11 +317,9 @@ class _ShrineHomeState extends State<ShrineHome> {
final
Product
featured
=
_products
.
firstWhere
((
Product
product
)
=>
product
.
featureDescription
!=
null
);
final
Product
featured
=
_products
.
firstWhere
((
Product
product
)
=>
product
.
featureDescription
!=
null
);
return
new
ShrinePage
(
return
new
ShrinePage
(
scaffoldKey:
scaffoldKey
,
scaffoldKey:
scaffoldKey
,
scrollableKey:
scrollableKey
,
products:
_products
,
products:
_products
,
shoppingCart:
_shoppingCart
,
shoppingCart:
_shoppingCart
,
body:
new
ScrollableViewport
(
body:
new
ScrollableViewport
(
scrollableKey:
scrollableKey
,
child:
new
RepaintBoundary
(
child:
new
RepaintBoundary
(
child:
new
Column
(
child:
new
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
View file @
e05dcc9c
...
@@ -135,7 +135,6 @@ class OrderPage extends StatefulWidget {
...
@@ -135,7 +135,6 @@ class OrderPage extends StatefulWidget {
/// order to the shopping cart.
/// order to the shopping cart.
class
_OrderPageState
extends
State
<
OrderPage
>
{
class
_OrderPageState
extends
State
<
OrderPage
>
{
static
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>(
debugLabel:
'Shrine Order'
);
static
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>(
debugLabel:
'Shrine Order'
);
static
final
GlobalKey
<
ScrollableState
>
scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
Order
get
currentOrder
=>
ShrineOrderRoute
.
of
(
context
).
order
;
Order
get
currentOrder
=>
ShrineOrderRoute
.
of
(
context
).
order
;
...
@@ -161,7 +160,6 @@ class _OrderPageState extends State<OrderPage> {
...
@@ -161,7 +160,6 @@ class _OrderPageState extends State<OrderPage> {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
new
ShrinePage
(
return
new
ShrinePage
(
scaffoldKey:
scaffoldKey
,
scaffoldKey:
scaffoldKey
,
scrollableKey:
scrollableKey
,
products:
config
.
products
,
products:
config
.
products
,
shoppingCart:
config
.
shoppingCart
,
shoppingCart:
config
.
shoppingCart
,
floatingActionButton:
new
FloatingActionButton
(
floatingActionButton:
new
FloatingActionButton
(
...
@@ -180,7 +178,6 @@ class _OrderPageState extends State<OrderPage> {
...
@@ -180,7 +178,6 @@ class _OrderPageState extends State<OrderPage> {
)
)
),
),
body:
new
Block
(
body:
new
Block
(
scrollableKey:
scrollableKey
,
children:
<
Widget
>[
children:
<
Widget
>[
new
OrderItem
(
new
OrderItem
(
product:
config
.
order
.
product
,
product:
config
.
order
.
product
,
...
@@ -211,7 +208,6 @@ class _OrderPageState extends State<OrderPage> {
...
@@ -211,7 +208,6 @@ class _OrderPageState extends State<OrderPage> {
]
]
)
)
);
);
}
}
}
}
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
View file @
e05dcc9c
...
@@ -17,7 +17,6 @@ class ShrinePage extends StatefulWidget {
...
@@ -17,7 +17,6 @@ class ShrinePage extends StatefulWidget {
ShrinePage
({
ShrinePage
({
Key
key
,
Key
key
,
this
.
scaffoldKey
,
this
.
scaffoldKey
,
this
.
scrollableKey
,
this
.
body
,
this
.
body
,
this
.
floatingActionButton
,
this
.
floatingActionButton
,
this
.
products
,
this
.
products
,
...
@@ -28,7 +27,6 @@ class ShrinePage extends StatefulWidget {
...
@@ -28,7 +27,6 @@ class ShrinePage extends StatefulWidget {
}
}
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
;
final
GlobalKey
<
ScaffoldState
>
scaffoldKey
;
final
GlobalKey
<
ScrollableState
>
scrollableKey
;
final
Widget
body
;
final
Widget
body
;
final
Widget
floatingActionButton
;
final
Widget
floatingActionButton
;
final
List
<
Product
>
products
;
final
List
<
Product
>
products
;
...
@@ -88,7 +86,6 @@ class ShrinePageState extends State<ShrinePage> {
...
@@ -88,7 +86,6 @@ class ShrinePageState extends State<ShrinePage> {
final
ShrineTheme
theme
=
ShrineTheme
.
of
(
context
);
final
ShrineTheme
theme
=
ShrineTheme
.
of
(
context
);
return
new
Scaffold
(
return
new
Scaffold
(
key:
config
.
scaffoldKey
,
key:
config
.
scaffoldKey
,
scrollableKey:
config
.
scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
elevation:
_appBarElevation
,
elevation:
_appBarElevation
,
backgroundColor:
theme
.
appBarBackgroundColor
,
backgroundColor:
theme
.
appBarBackgroundColor
,
...
...
examples/flutter_gallery/lib/demo/tabs_demo.dart
View file @
e05dcc9c
...
@@ -9,7 +9,6 @@ import 'package:flutter/material.dart';
...
@@ -9,7 +9,6 @@ import 'package:flutter/material.dart';
class
_Page
{
class
_Page
{
_Page
({
this
.
label
});
_Page
({
this
.
label
});
final
GlobalKey
<
ScrollableState
>
scrollableKey
=
new
GlobalKey
<
ScrollableState
>();
final
String
label
;
final
String
label
;
String
get
id
=>
label
[
0
];
String
get
id
=>
label
[
0
];
}
}
...
@@ -122,25 +121,11 @@ class TabsDemo extends StatefulWidget {
...
@@ -122,25 +121,11 @@ class TabsDemo extends StatefulWidget {
}
}
class
_TabsDemoState
extends
State
<
TabsDemo
>
{
class
_TabsDemoState
extends
State
<
TabsDemo
>
{
_Page
_selectedPage
;
@override
void
initState
()
{
super
.
initState
();
_selectedPage
=
_allPages
.
keys
.
first
;
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
new
TabBarSelection
<
_Page
>(
return
new
TabBarSelection
<
_Page
>(
values:
_allPages
.
keys
.
toList
(),
values:
_allPages
.
keys
.
toList
(),
onChanged:
(
_Page
value
)
{
setState
(()
{
_selectedPage
=
value
;
});
},
child:
new
Scaffold
(
child:
new
Scaffold
(
scrollableKey:
_selectedPage
.
scrollableKey
,
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
new
Text
(
'Tabs and scrolling'
),
title:
new
Text
(
'Tabs and scrolling'
),
bottom:
new
TabBar
<
_Page
>(
bottom:
new
TabBar
<
_Page
>(
...
@@ -152,7 +137,6 @@ class _TabsDemoState extends State<TabsDemo> {
...
@@ -152,7 +137,6 @@ class _TabsDemoState extends State<TabsDemo> {
body:
new
TabBarView
<
_Page
>(
body:
new
TabBarView
<
_Page
>(
children:
_allPages
.
keys
.
map
((
_Page
page
)
{
children:
_allPages
.
keys
.
map
((
_Page
page
)
{
return
new
ScrollableList
(
return
new
ScrollableList
(
scrollableKey:
page
.
scrollableKey
,
padding:
const
EdgeInsets
.
symmetric
(
vertical:
8.0
,
horizontal:
16.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
8.0
,
horizontal:
16.0
),
itemExtent:
_CardDataItem
.
height
,
itemExtent:
_CardDataItem
.
height
,
children:
_allPages
[
page
].
map
((
_CardData
data
)
{
children:
_allPages
[
page
].
map
((
_CardData
data
)
{
...
...
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