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
1d516f0e
Commit
1d516f0e
authored
Jun 03, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update gallery demo list (again) (#4339)
parent
f2ea70d9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
181 deletions
+29
-181
flutter.yaml
examples/flutter_gallery/flutter.yaml
+5
-0
all.dart
examples/flutter_gallery/lib/demo/all.dart
+1
-1
contacts_demo.dart
examples/flutter_gallery/lib/demo/contacts_demo.dart
+4
-4
scrolling_techniques_demo.dart
...s/flutter_gallery/lib/demo/scrolling_techniques_demo.dart
+0
-159
shrine_data.dart
examples/flutter_gallery/lib/demo/shrine/shrine_data.dart
+5
-5
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+2
-2
shrine_types.dart
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
+3
-3
app.dart
examples/flutter_gallery/lib/gallery/app.dart
+3
-2
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+2
-2
simple_smoke_test.dart
examples/flutter_gallery/test/simple_smoke_test.dart
+1
-1
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+3
-2
No files found.
examples/flutter_gallery/flutter.yaml
View file @
1d516f0e
...
...
@@ -26,6 +26,11 @@ assets:
-
packages/flutter_gallery_assets/landscape_10.jpg
-
packages/flutter_gallery_assets/landscape_11.jpg
-
lib/gallery/example_code.dart
-
packages/flutter_gallery_assets/shrine/vendors/16c477b.jpg
-
packages/flutter_gallery_assets/shrine/vendors/ali-connors.png
-
packages/flutter_gallery_assets/shrine/vendors/peter-carlsson.png
-
packages/flutter_gallery_assets/shrine/vendors/sandra-adams.jpg
-
packages/flutter_gallery_assets/shrine/vendors/zach.jpg
fonts
:
-
family
:
AbrilFatface
fonts
:
...
...
examples/flutter_gallery/lib/demo/all.dart
View file @
1d516f0e
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
export
'buttons_demo.dart'
;
export
'contacts_demo.dart'
;
export
'cards_demo.dart'
;
export
'calculator_demo.dart'
;
export
'chip_demo.dart'
;
...
...
@@ -11,7 +12,6 @@ export 'data_table_demo.dart';
export
'date_picker_demo.dart'
;
export
'dialog_demo.dart'
;
export
'drop_down_demo.dart'
;
export
'flexible_space_demo.dart'
;
export
'grid_list_demo.dart'
;
export
'icons_demo.dart'
;
export
'leave_behind_demo.dart'
;
...
...
examples/flutter_gallery/lib/demo/
flexible_space
_demo.dart
→
examples/flutter_gallery/lib/demo/
contacts
_demo.dart
View file @
1d516f0e
...
...
@@ -70,14 +70,14 @@ class _ContactItem extends StatelessWidget {
}
}
class
FlexibleSpace
Demo
extends
StatefulWidget
{
static
const
String
routeName
=
'/
flexible-space
'
;
class
Contacts
Demo
extends
StatefulWidget
{
static
const
String
routeName
=
'/
contacts
'
;
@override
FlexibleSpaceDemoState
createState
()
=>
new
FlexibleSpace
DemoState
();
ContactsDemoState
createState
()
=>
new
Contacts
DemoState
();
}
class
FlexibleSpaceDemoState
extends
State
<
FlexibleSpace
Demo
>
{
class
ContactsDemoState
extends
State
<
Contacts
Demo
>
{
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
final
double
_appBarHeight
=
256.0
;
AppBarBehavior
_appBarBehavior
=
AppBarBehavior
.
scroll
;
...
...
examples/flutter_gallery/lib/demo/scrolling_techniques_demo.dart
deleted
100644 → 0
View file @
f2ea70d9
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'flexible_space_demo.dart'
;
class
_BarGraphic
extends
StatelessWidget
{
_BarGraphic
({
Key
key
,
this
.
height
,
this
.
color
,
this
.
leftText
,
this
.
rightText
:
''
})
:
super
(
key:
key
)
{
assert
(
height
!=
null
);
assert
(
color
!=
null
);
assert
(
leftText
!=
null
);
}
final
double
height
;
final
Color
color
;
final
String
leftText
;
final
String
rightText
;
@override
Widget
build
(
BuildContext
context
)
{
return
new
Container
(
height:
height
,
width:
200.0
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
color
),
child:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
body1
.
copyWith
(
color:
Colors
.
white
),
child:
new
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
new
Text
(
leftText
),
new
Text
(
rightText
)
]
)
)
);
}
}
class
_StatusBarGraphic
extends
_BarGraphic
{
_StatusBarGraphic
()
:
super
(
height:
24.0
,
color:
Colors
.
green
[
400
],
leftText:
'Status Bar'
,
rightText:
'24dp'
);
}
class
_AppBarGraphic
extends
_BarGraphic
{
_AppBarGraphic
()
:
super
(
height:
48.0
,
color:
Colors
.
blue
[
400
],
leftText:
'Tool Bar'
,
rightText:
'48dp'
);
}
class
_TabBarGraphic
extends
_BarGraphic
{
_TabBarGraphic
()
:
super
(
height:
48.0
,
color:
Colors
.
purple
[
400
],
leftText:
'Tab Bar'
,
rightText:
'56dp'
);
}
class
_FlexibleSpaceGraphic
extends
_BarGraphic
{
_FlexibleSpaceGraphic
()
:
super
(
height:
128.0
,
color:
Colors
.
pink
[
400
],
leftText:
'Flexible Space'
);
}
class
_TechniqueItem
extends
StatelessWidget
{
_TechniqueItem
({
this
.
titleText
,
this
.
barGraphics
,
this
.
builder
});
final
String
titleText
;
final
List
<
Widget
>
barGraphics
;
final
WidgetBuilder
builder
;
void
showDemo
(
BuildContext
context
)
{
Navigator
.
push
(
context
,
new
MaterialPageRoute
<
Null
>(
builder:
builder
));
}
@override
Widget
build
(
BuildContext
context
)
{
return
new
Card
(
child:
new
InkWell
(
onTap:
()
{
showDemo
(
context
);
},
child:
new
Padding
(
padding:
const
EdgeInsets
.
all
(
16.0
),
child:
new
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children
:<
Widget
>[
new
Text
(
titleText
),
new
Column
(
children:
barGraphics
)
]
)
)
)
);
}
}
const
String
_introText
=
"An AppBar is a combination of a ToolBar and a TabBar or a flexible space "
"Widget that is managed by the Scaffold. The Scaffold pads the ToolBar so that "
"it appears behind the device's status bar. When a flexible space Widget is "
"specified it is stacked on top of the ToolBar."
;
class
ScrollingTechniquesDemo
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
appBar:
new
AppBar
(
title:
new
Text
(
'Scrolling techniques'
)),
body:
new
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
),
child:
new
Block
(
children:
<
Widget
>[
new
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
,
vertical:
32.0
),
child:
new
Text
(
_introText
,
style:
Theme
.
of
(
context
).
textTheme
.
caption
)
),
new
_TechniqueItem
(
builder:
(
BuildContext
context
)
=>
new
FlexibleSpaceDemo
(),
titleText:
'Standard'
,
barGraphics:
<
Widget
>[
new
_StatusBarGraphic
(),
new
_AppBarGraphic
()
]
),
new
_TechniqueItem
(
titleText:
'Tabs'
,
builder:
(
BuildContext
context
)
=>
new
FlexibleSpaceDemo
(),
barGraphics:
<
Widget
>[
new
_StatusBarGraphic
(),
new
_AppBarGraphic
(),
new
_TabBarGraphic
()
]
),
new
_TechniqueItem
(
titleText:
'Flexible'
,
builder:
(
BuildContext
context
)
=>
new
FlexibleSpaceDemo
(),
barGraphics:
<
Widget
>[
new
_StatusBarGraphic
(),
new
_AppBarGraphic
(),
new
_FlexibleSpaceGraphic
()
]
)
]
)
)
);
}
}
examples/flutter_gallery/lib/demo/shrine/shrine_data.dart
View file @
1d516f0e
...
...
@@ -6,7 +6,7 @@ import 'shrine_types.dart';
const
Vendor
_ali
=
const
Vendor
(
name:
'Ali’s shop'
,
avatar
Url:
'https://www.gstatic.com/angular/material-adaptive/shrine
/ali-connors.png'
,
avatar
Asset:
'packages/flutter_gallery_assets/shrine/vendors
/ali-connors.png'
,
description:
'Ali Connor’s makes custom goods for folks of all shapes and sizes '
'made by hand and sometimes by machine, but always with love and care. '
...
...
@@ -15,7 +15,7 @@ const Vendor _ali = const Vendor(
const
Vendor
_sandra
=
const
Vendor
(
name:
'Sandra’s shop'
,
avatar
Url:
'https://www.gstatic.com/angular/material-adaptive/shrine
/sandra-adams.jpg'
,
avatar
Asset:
'packages/flutter_gallery_assets/shrine/vendors
/sandra-adams.jpg'
,
description:
'Sandra specializes in furniture, beauty and travel products with a classic vibe. '
'Custom orders are available if you’re looking for a certain color or material.'
...
...
@@ -23,7 +23,7 @@ const Vendor _sandra = const Vendor(
const
Vendor
_trevor
=
const
Vendor
(
name:
'Trevor’s shop'
,
avatar
Url:
'https://www.gstatic.com/angular/material-adaptive/shrine
/zach.jpg'
,
avatar
Asset:
'packages/flutter_gallery_assets/shrine/vendors
/zach.jpg'
,
description:
'Trevor makes great stuff for awesome people like you. Super cool and extra '
'awesome all of his shop’s goods are handmade with love. Custom orders are '
...
...
@@ -32,7 +32,7 @@ const Vendor _trevor = const Vendor(
const
Vendor
_peter
=
const
Vendor
(
name:
'Peter’s shop'
,
avatar
Url:
'https://www.gstatic.com/angular/material-adaptive/shrine
/peter-carlsson.png'
,
avatar
Asset:
'packages/flutter_gallery_assets/shrine/vendors
/peter-carlsson.png'
,
description:
'Peter makes great stuff for awesome people like you. Super cool and extra '
'awesome all of his shop’s goods are handmade with love. Custom orders are '
...
...
@@ -41,7 +41,7 @@ const Vendor _peter = const Vendor(
const
Vendor
_stella
=
const
Vendor
(
name:
'Stella’s shop'
,
avatar
Url:
'https://www.gstatic.com/angular/material-adaptive/shrine
/16c477b.jpg'
,
avatar
Asset:
'packages/flutter_gallery_assets/shrine/vendors
/16c477b.jpg'
,
description:
'Stella sells awesome stuff at lovely prices. made by hand and sometimes by '
'machine, but always with love and care. Custom orders are available upon request '
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
1d516f0e
...
...
@@ -36,9 +36,9 @@ class VendorItem extends StatelessWidget {
child:
new
ClipRRect
(
xRadius:
12.0
,
yRadius:
12.0
,
child:
new
Network
Image
(
child:
new
Asset
Image
(
fit:
ImageFit
.
cover
,
src:
vendor
.
avatarUrl
name:
vendor
.
avatarAsset
)
)
),
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
View file @
1d516f0e
...
...
@@ -10,17 +10,17 @@ class Vendor {
const
Vendor
({
this
.
name
,
this
.
description
,
this
.
avatar
Url
this
.
avatar
Asset
});
final
String
name
;
final
String
description
;
final
String
avatar
Url
;
final
String
avatar
Asset
;
bool
isValid
()
{
return
name
!=
null
&&
description
!=
null
&&
avatar
Url
!=
null
;
avatar
Asset
!=
null
;
}
@override
...
...
examples/flutter_gallery/lib/gallery/app.dart
View file @
1d516f0e
...
...
@@ -8,11 +8,11 @@ import 'package:flutter/scheduler.dart' show timeDilation;
import
'../demo/all.dart'
;
import
'home.dart'
;
// Warning: this list must be in the same order that the demos appear in GalleryHome.
final
Map
<
String
,
WidgetBuilder
>
kRoutes
=
<
String
,
WidgetBuilder
>{
ShrineDemo
.
routeName
:
(
BuildContext
context
)
=>
new
ShrineDemo
(),
Calculator
.
routeName
:
(
BuildContext
context
)
=>
new
Calculator
(),
FlexibleSpaceDemo
.
routeName
:
(
BuildContext
context
)
=>
new
FlexibleSpaceDemo
(),
TabsFabDemo
.
routeName
:
(
BuildContext
context
)
=>
new
TabsFabDemo
(),
ContactsDemo
.
routeName
:
(
BuildContext
context
)
=>
new
ContactsDemo
(),
ButtonsDemo
.
routeName
:
(
BuildContext
context
)
=>
new
ButtonsDemo
(),
CardsDemo
.
routeName
:
(
BuildContext
context
)
=>
new
CardsDemo
(),
ChipDemo
.
routeName
:
(
BuildContext
context
)
=>
new
ChipDemo
(),
...
...
@@ -21,6 +21,7 @@ final Map<String, WidgetBuilder> kRoutes = <String, WidgetBuilder>{
DialogDemo
.
routeName
:
(
BuildContext
context
)
=>
new
DialogDemo
(),
DropDownDemo
.
routeName
:
(
BuildContext
context
)
=>
new
DropDownDemo
(),
TwoLevelListDemo
.
routeName
:
(
BuildContext
context
)
=>
new
TwoLevelListDemo
(),
TabsFabDemo
.
routeName
:
(
BuildContext
context
)
=>
new
TabsFabDemo
(),
GridListDemo
.
routeName
:
(
BuildContext
context
)
=>
new
GridListDemo
(),
IconsDemo
.
routeName
:
(
BuildContext
context
)
=>
new
IconsDemo
(),
LeaveBehindDemo
.
routeName
:
(
BuildContext
context
)
=>
new
LeaveBehindDemo
(),
...
...
examples/flutter_gallery/lib/gallery/home.dart
View file @
1d516f0e
...
...
@@ -73,8 +73,7 @@ class GalleryHomeState extends State<GalleryHome> {
children:
<
Widget
>[
new
GalleryItem
(
title:
'Shrine'
,
routeName:
ShrineDemo
.
routeName
),
new
GalleryItem
(
title:
'Calculator'
,
routeName:
Calculator
.
routeName
),
new
GalleryItem
(
title:
'Flexible space toolbar'
,
routeName:
FlexibleSpaceDemo
.
routeName
),
new
GalleryItem
(
title:
'Floating action button'
,
routeName:
TabsFabDemo
.
routeName
),
new
GalleryItem
(
title:
'Contacts'
,
routeName:
ContactsDemo
.
routeName
)
]
),
new
TwoLevelSublist
(
...
...
@@ -89,6 +88,7 @@ class GalleryHomeState extends State<GalleryHome> {
new
GalleryItem
(
title:
'Dialog'
,
routeName:
DialogDemo
.
routeName
),
new
GalleryItem
(
title:
'Drop-down button'
,
routeName:
DropDownDemo
.
routeName
),
new
GalleryItem
(
title:
'Expand/collapse list control'
,
routeName:
TwoLevelListDemo
.
routeName
),
new
GalleryItem
(
title:
'Floating action button'
,
routeName:
TabsFabDemo
.
routeName
),
new
GalleryItem
(
title:
'Grid'
,
routeName:
GridListDemo
.
routeName
),
new
GalleryItem
(
title:
'Icons'
,
routeName:
IconsDemo
.
routeName
),
new
GalleryItem
(
title:
'Leave-behind list items'
,
routeName:
LeaveBehindDemo
.
routeName
),
...
...
examples/flutter_gallery/test/simple_smoke_test.dart
View file @
1d516f0e
...
...
@@ -42,7 +42,7 @@ void main() {
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// end animation
// Open Flexible space toolbar
await
tester
.
tap
(
find
.
text
(
'
Flexible space toolbar
'
));
await
tester
.
tap
(
find
.
text
(
'
Contacts
'
));
await
tester
.
pump
();
// start animation
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// end animation
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
1d516f0e
...
...
@@ -15,8 +15,8 @@ import 'package:test/test.dart';
const
List
<
String
>
demoCategories
=
const
<
String
>[
'Demos'
,
'Components'
,
'Style'
];
const
List
<
String
>
demoNames
=
const
<
String
>[
'
Flexible space toolbar
'
,
'
Floating action button
'
,
'
Shrine
'
,
'
Contacts
'
,
'Buttons'
,
'Cards'
,
'Chips'
,
...
...
@@ -25,6 +25,7 @@ const List<String> demoNames = const <String>[
'Dialog'
,
'Drop-down button'
,
'Expand/collapse list control'
,
'Floating action button'
,
'Grid'
,
'Icons'
,
'Leave-behind list items'
,
...
...
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