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
eee986b0
Unverified
Commit
eee986b0
authored
May 07, 2018
by
Hans Muller
Committed by
GitHub
May 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gallery cosmetic updates (#17310)
parent
e8d08744
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
18 deletions
+53
-18
bottom_app_bar_demo.dart
...lutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
+28
-8
demos.dart
examples/flutter_gallery/lib/gallery/demos.dart
+1
-1
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+16
-1
pesto_test.dart
examples/flutter_gallery/test/pesto_test.dart
+2
-2
simple_smoke_test.dart
examples/flutter_gallery/test/simple_smoke_test.dart
+2
-2
update_test.dart
examples/flutter_gallery/test/update_test.dart
+1
-1
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+3
-3
No files found.
examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
View file @
eee986b0
...
@@ -11,6 +11,10 @@ class BottomAppBarDemo extends StatefulWidget {
...
@@ -11,6 +11,10 @@ class BottomAppBarDemo extends StatefulWidget {
State
createState
()
=>
new
_BottomAppBarDemoState
();
State
createState
()
=>
new
_BottomAppBarDemoState
();
}
}
// Flutter generally frowns upon abbrevation however this class uses two
// abbrevations extensively: "fab" for floating action button, and "bab"
// for bottom application bar.
class
_BottomAppBarDemoState
extends
State
<
BottomAppBarDemo
>
{
class
_BottomAppBarDemoState
extends
State
<
BottomAppBarDemo
>
{
static
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
static
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
new
GlobalKey
<
ScaffoldState
>();
...
@@ -138,6 +142,16 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
...
@@ -138,6 +142,16 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
appBar:
new
AppBar
(
appBar:
new
AppBar
(
title:
const
Text
(
'Bottom app bar'
),
title:
const
Text
(
'Bottom app bar'
),
elevation:
0.0
,
elevation:
0.0
,
actions:
<
Widget
>[
new
IconButton
(
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
),
onPressed:
()
{
setState
(()
{
_fabShape
=
_fabShape
==
kCircularFab
?
kDiamondFab
:
kCircularFab
;
});
},
),
],
),
),
body:
new
ListView
(
body:
new
ListView
(
padding:
const
EdgeInsets
.
only
(
bottom:
88.0
),
padding:
const
EdgeInsets
.
only
(
bottom:
88.0
),
...
@@ -155,7 +169,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
...
@@ -155,7 +169,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
new
_RadioItem
<
bool
>(
kShowNotchFalse
,
_showNotch
,
_onShowNotchChanged
),
new
_RadioItem
<
bool
>(
kShowNotchFalse
,
_showNotch
,
_onShowNotchChanged
),
const
Divider
(),
const
Divider
(),
const
_Heading
(
'
Notch
'
),
const
_Heading
(
'
FAB Position
'
),
new
_RadioItem
<
FloatingActionButtonLocation
>(
kFabEndDocked
,
_fabLocation
,
_onFabLocationChanged
),
new
_RadioItem
<
FloatingActionButtonLocation
>(
kFabEndDocked
,
_fabLocation
,
_onFabLocationChanged
),
new
_RadioItem
<
FloatingActionButtonLocation
>(
kFabCenterDocked
,
_fabLocation
,
_onFabLocationChanged
),
new
_RadioItem
<
FloatingActionButtonLocation
>(
kFabCenterDocked
,
_fabLocation
,
_onFabLocationChanged
),
...
@@ -214,10 +228,18 @@ class _RadioItem<T> extends StatelessWidget {
...
@@ -214,10 +228,18 @@ class _RadioItem<T> extends StatelessWidget {
),
),
new
Expanded
(
new
Expanded
(
child:
new
Semantics
(
child:
new
Semantics
(
container:
true
,
button:
true
,
label:
value
.
label
,
label:
value
.
label
,
child:
new
Text
(
child:
new
GestureDetector
(
value
.
title
,
behavior:
HitTestBehavior
.
opaque
,
style:
theme
.
textTheme
.
subhead
,
onTap:
()
{
onChanged
(
value
);
},
child:
new
Text
(
value
.
title
,
style:
theme
.
textTheme
.
subhead
,
),
),
),
),
),
),
),
...
@@ -252,7 +274,7 @@ class _ColorsItem extends StatelessWidget {
...
@@ -252,7 +274,7 @@ class _ColorsItem extends StatelessWidget {
fillColor:
color
,
fillColor:
color
,
shape:
new
CircleBorder
(
shape:
new
CircleBorder
(
side:
new
BorderSide
(
side:
new
BorderSide
(
color:
color
==
null
?
Colors
.
black
:
const
Color
(
0xFFD5D7DA
),
color:
color
==
selectedColor
?
Colors
.
black
:
const
Color
(
0xFFD5D7DA
),
width:
2.0
,
width:
2.0
,
),
),
),
),
...
@@ -339,9 +361,7 @@ class _DemoBottomAppBar extends StatelessWidget {
...
@@ -339,9 +361,7 @@ class _DemoBottomAppBar extends StatelessWidget {
return
new
BottomAppBar
(
return
new
BottomAppBar
(
color:
color
,
color:
color
,
hasNotch:
showNotch
,
hasNotch:
showNotch
,
child:
new
Row
(
child:
new
Row
(
children:
rowContents
),
children:
rowContents
,
),
);
);
}
}
}
}
...
...
examples/flutter_gallery/lib/gallery/demos.dart
View file @
eee986b0
...
@@ -32,7 +32,7 @@ class GalleryDemoCategory {
...
@@ -32,7 +32,7 @@ class GalleryDemoCategory {
}
}
const
GalleryDemoCategory
_kDemos
=
const
GalleryDemoCategory
.
_
(
const
GalleryDemoCategory
_kDemos
=
const
GalleryDemoCategory
.
_
(
name:
'
Vignett
es'
,
name:
'
Studi
es'
,
icon:
GalleryIcons
.
animation
,
icon:
GalleryIcons
.
animation
,
);
);
...
...
examples/flutter_gallery/lib/gallery/home.dart
View file @
eee986b0
...
@@ -122,7 +122,6 @@ class _CategoriesPage extends StatelessWidget {
...
@@ -122,7 +122,6 @@ class _CategoriesPage extends StatelessWidget {
// LayoutBuilder.
// LayoutBuilder.
return
new
RepaintBoundary
(
return
new
RepaintBoundary
(
child:
new
Column
(
child:
new
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
new
List
<
Widget
>.
generate
(
rowCount
,
(
int
rowIndex
)
{
children:
new
List
<
Widget
>.
generate
(
rowCount
,
(
int
rowIndex
)
{
...
@@ -289,11 +288,21 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
...
@@ -289,11 +288,21 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
super
.
dispose
();
super
.
dispose
();
}
}
static
Widget
_animatedSwitcherLayoutBuilder
(
List
<
Widget
>
children
)
{
return
new
Stack
(
children:
children
,
alignment:
Alignment
.
topLeft
,
);
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
ThemeData
theme
=
Theme
.
of
(
context
);
final
bool
isDark
=
theme
.
brightness
==
Brightness
.
dark
;
final
bool
isDark
=
theme
.
brightness
==
Brightness
.
dark
;
const
Curve
switchOutCurve
=
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
);
const
Curve
switchInCurve
=
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
);
Widget
home
=
new
Scaffold
(
Widget
home
=
new
Scaffold
(
key:
_scaffoldKey
,
key:
_scaffoldKey
,
backgroundColor:
isDark
?
_kFlutterBlue
:
theme
.
primaryColor
,
backgroundColor:
isDark
?
_kFlutterBlue
:
theme
.
primaryColor
,
...
@@ -313,6 +322,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
...
@@ -313,6 +322,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
backLayer:
widget
.
optionsPage
,
backLayer:
widget
.
optionsPage
,
frontAction:
new
AnimatedSwitcher
(
frontAction:
new
AnimatedSwitcher
(
duration:
_kFrontLayerSwitchDuration
,
duration:
_kFrontLayerSwitchDuration
,
switchOutCurve:
switchOutCurve
,
switchInCurve:
switchInCurve
,
layoutBuilder:
_animatedSwitcherLayoutBuilder
,
child:
_category
==
null
child:
_category
==
null
?
const
_FlutterLogo
()
?
const
_FlutterLogo
()
:
new
IconButton
(
:
new
IconButton
(
...
@@ -330,6 +342,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
...
@@ -330,6 +342,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
frontHeading:
new
Container
(
height:
24.0
),
frontHeading:
new
Container
(
height:
24.0
),
frontLayer:
new
AnimatedSwitcher
(
frontLayer:
new
AnimatedSwitcher
(
duration:
_kFrontLayerSwitchDuration
,
duration:
_kFrontLayerSwitchDuration
,
switchOutCurve:
switchOutCurve
,
switchInCurve:
switchInCurve
,
layoutBuilder:
_animatedSwitcherLayoutBuilder
,
child:
_category
!=
null
child:
_category
!=
null
?
new
_DemosPage
(
_category
)
?
new
_DemosPage
(
_category
)
:
new
_CategoriesPage
(
:
new
_CategoriesPage
(
...
...
examples/flutter_gallery/test/pesto_test.dart
View file @
eee986b0
...
@@ -26,7 +26,7 @@ void main() {
...
@@ -26,7 +26,7 @@ void main() {
await
tester
.
pump
();
// see https://github.com/flutter/flutter/issues/1865
await
tester
.
pump
();
// see https://github.com/flutter/flutter/issues/1865
await
tester
.
pump
();
// triggers a frame
await
tester
.
pump
();
// triggers a frame
await
tester
.
tap
(
find
.
text
(
'
Vignett
es'
));
await
tester
.
tap
(
find
.
text
(
'
Studi
es'
));
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'Pesto'
));
await
tester
.
tap
(
find
.
text
(
'Pesto'
));
...
@@ -47,7 +47,7 @@ void main() {
...
@@ -47,7 +47,7 @@ void main() {
await
tester
.
pump
();
// see https://github.com/flutter/flutter/issues/1865
await
tester
.
pump
();
// see https://github.com/flutter/flutter/issues/1865
await
tester
.
pump
();
// triggers a frame
await
tester
.
pump
();
// triggers a frame
await
tester
.
tap
(
find
.
text
(
'
Vignett
es'
));
await
tester
.
tap
(
find
.
text
(
'
Studi
es'
));
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
find
.
text
(
'Pesto'
));
await
tester
.
tap
(
find
.
text
(
'Pesto'
));
...
...
examples/flutter_gallery/test/simple_smoke_test.dart
View file @
eee986b0
...
@@ -31,8 +31,8 @@ void main() {
...
@@ -31,8 +31,8 @@ void main() {
await
tester
.
tap
(
showOptionsPageButton
);
await
tester
.
tap
(
showOptionsPageButton
);
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
// Show the
vignettes
// Show the
studies (aka "vignettes", aka "demos")
await
tester
.
tap
(
find
.
text
(
'
Vignett
es'
));
await
tester
.
tap
(
find
.
text
(
'
Studi
es'
));
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
// Show the Contact profile demo and scroll it upwards
// Show the Contact profile demo and scroll it upwards
...
...
examples/flutter_gallery/test/update_test.dart
View file @
eee986b0
...
@@ -26,7 +26,7 @@ void main() {
...
@@ -26,7 +26,7 @@ void main() {
await
tester
.
tap
(
find
.
text
(
'NO THANKS'
));
await
tester
.
tap
(
find
.
text
(
'NO THANKS'
));
await
tester
.
pump
();
await
tester
.
pump
();
await
tester
.
tap
(
find
.
text
(
'
Vignett
es'
));
await
tester
.
tap
(
find
.
text
(
'
Studi
es'
));
await
tester
.
pump
();
// Launch
await
tester
.
pump
();
// Launch
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// transition is complete
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// transition is complete
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
eee986b0
...
@@ -24,9 +24,9 @@ const FileSystem _fs = const LocalFileSystem();
...
@@ -24,9 +24,9 @@ const FileSystem _fs = const LocalFileSystem();
// These names must match GalleryItem titles from kAllGalleryDemos
// These names must match GalleryItem titles from kAllGalleryDemos
// in examples/flutter_gallery/lib/gallery/demos.dart
// in examples/flutter_gallery/lib/gallery/demos.dart
const
List
<
String
>
kProfiledDemos
=
const
<
String
>[
const
List
<
String
>
kProfiledDemos
=
const
<
String
>[
'Shrine@
Vignett
es'
,
'Shrine@
Studi
es'
,
'Contact profile@
Vignett
es'
,
'Contact profile@
Studi
es'
,
'Animation@
Vignett
es'
,
'Animation@
Studi
es'
,
'Bottom navigation@Material'
,
'Bottom navigation@Material'
,
'Buttons@Material'
,
'Buttons@Material'
,
'Cards@Material'
,
'Cards@Material'
,
...
...
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