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
c9954f10
Unverified
Commit
c9954f10
authored
May 04, 2018
by
Chris Bracken
Committed by
GitHub
May 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gallery demos: reordered and retitled (#17220) (#17273)
parent
c8908ff0
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
106 deletions
+111
-106
demos.dart
examples/flutter_gallery/lib/gallery/demos.dart
+63
-71
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+20
-13
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+28
-22
No files found.
examples/flutter_gallery/lib/gallery/demos.dart
View file @
c9954f10
This diff is collapsed.
Click to expand it.
examples/flutter_gallery/lib/gallery/home.dart
View file @
c9954f10
...
...
@@ -177,6 +177,25 @@ class _DemoItem extends StatelessWidget {
final
bool
isDark
=
theme
.
brightness
==
Brightness
.
dark
;
final
double
textScaleFactor
=
MediaQuery
.
of
(
context
)?.
textScaleFactor
??
1.0
;
final
List
<
Widget
>
titleChildren
=
<
Widget
>[
new
Text
(
demo
.
title
,
style:
theme
.
textTheme
.
subhead
.
copyWith
(
color:
isDark
?
Colors
.
white
:
const
Color
(
0xFF202124
),
),
),
];
if
(
demo
.
subtitle
!=
null
)
{
titleChildren
.
add
(
new
Text
(
demo
.
subtitle
,
style:
theme
.
textTheme
.
body1
.
copyWith
(
color:
isDark
?
Colors
.
white
:
const
Color
(
0xFF60646B
)
),
),
);
}
return
new
RawMaterialButton
(
padding:
EdgeInsets
.
zero
,
splashColor:
theme
.
primaryColor
.
withOpacity
(
0.12
),
...
...
@@ -202,19 +221,7 @@ class _DemoItem extends StatelessWidget {
child:
new
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
<
Widget
>[
new
Text
(
demo
.
title
,
style:
theme
.
textTheme
.
subhead
.
copyWith
(
color:
isDark
?
Colors
.
white
:
const
Color
(
0xFF202124
),
),
),
new
Text
(
demo
.
subtitle
,
style:
theme
.
textTheme
.
body1
.
copyWith
(
color:
isDark
?
Colors
.
white
:
const
Color
(
0xFF60646B
)),
),
],
children:
titleChildren
,
),
),
const
SizedBox
(
width:
44.0
),
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
c9954f10
...
...
@@ -21,28 +21,32 @@ const FileSystem _fs = const LocalFileSystem();
// --trace-startup, as we do in this test, the VM stores trace events in an
// endless buffer instead of a ring buffer.
//
// These names must match GalleryItem titles from
kAllGalleryItem
s
// in examples/flutter_gallery/lib/gallery
.item
.dart
// These names must match GalleryItem titles from
kAllGalleryDemo
s
// in examples/flutter_gallery/lib/gallery
/demos
.dart
const
List
<
String
>
kProfiledDemos
=
const
<
String
>[
'Shrine'
,
'Contact profile'
,
'Animation'
,
'Bottom navigation'
,
'Buttons'
,
'Cards'
,
'Chips'
,
'D
ate and time pickers
'
,
'
Dialog
'
,
'Shrine
@Vignettes
'
,
'Contact profile
@Vignettes
'
,
'Animation
@Vignettes
'
,
'Bottom navigation
@Material
'
,
'Buttons
@Material
'
,
'Cards
@Material
'
,
'Chips
@Material
'
,
'D
ialogs@Material
'
,
'
Pickers@Material
'
,
];
// Demos that will be backed out of within FlutterDriver.runUnsynchronized();
//
// These names must match GalleryItem titles from
kAllGalleryItem
s
// in examples/flutter_gallery/lib/gallery
.item
.dart
// These names must match GalleryItem titles from
kAllGalleryDemo
s
// in examples/flutter_gallery/lib/gallery
/demos
.dart
const
List
<
String
>
kUnsynchronizedDemos
=
const
<
String
>[
'Progress indicators'
,
'Activity Indicator'
,
'Video'
,
'Progress indicators@Material'
,
'Activity Indicator@Cupertino'
,
'Video@Media'
,
];
const
List
<
String
>
kSkippedDemos
=
const
<
String
>[
'Pull to refresh@Cupertino'
,
// The back button lacks a tooltip.
];
// All of the gallery demos, identified as "title@category".
...
...
@@ -124,9 +128,12 @@ Future<Null> runDemos(List<String> demos, FlutterDriver driver) async {
String
currentDemoCategory
;
for
(
String
demo
in
demos
)
{
final
String
demoAtCategory
=
_allDemos
.
firstWhere
((
String
s
)
=>
s
.
startsWith
(
demo
));
final
String
demoCategory
=
demoAtCategory
.
substring
(
demoAtCategory
.
indexOf
(
'@'
)
+
1
);
print
(
'>
$demoAtCategory
'
);
if
(
kSkippedDemos
.
contains
(
demo
))
continue
;
final
String
demoName
=
demo
.
substring
(
0
,
demo
.
indexOf
(
'@'
));
final
String
demoCategory
=
demo
.
substring
(
demo
.
indexOf
(
'@'
)
+
1
);
print
(
'>
$demo
'
);
if
(
currentDemoCategory
==
null
)
{
await
driver
.
tap
(
find
.
text
(
demoCategory
));
...
...
@@ -138,7 +145,7 @@ Future<Null> runDemos(List<String> demos, FlutterDriver driver) async {
}
currentDemoCategory
=
demoCategory
;
final
SerializableFinder
demoItem
=
find
.
text
(
demo
);
final
SerializableFinder
demoItem
=
find
.
text
(
demo
Name
);
await
driver
.
scrollUntilVisible
(
demoList
,
demoItem
,
dyScroll:
-
48.0
,
alignment:
0.5
);
for
(
int
i
=
0
;
i
<
2
;
i
+=
1
)
{
...
...
@@ -204,8 +211,7 @@ void main([List<String> args = const <String>[]]) {
await
saveDurationsHistogram
(
timeline
.
json
[
'traceEvents'
],
histogramPath
);
// Execute the remaining tests.
final
List
<
String
>
allDemoNames
=
_allDemos
.
map
((
String
s
)
=>
s
.
substring
(
0
,
s
.
indexOf
(
'@'
)));
final
Set
<
String
>
unprofiledDemos
=
new
Set
<
String
>.
from
(
allDemoNames
)..
removeAll
(
kProfiledDemos
);
final
Set
<
String
>
unprofiledDemos
=
new
Set
<
String
>.
from
(
_allDemos
)..
removeAll
(
kProfiledDemos
);
await
runDemos
(
unprofiledDemos
.
toList
(),
driver
);
},
timeout:
const
Timeout
(
const
Duration
(
minutes:
5
)));
...
...
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