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
0d7b61f5
Commit
0d7b61f5
authored
Apr 22, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve elevation docs (#3502)
Fixes #3501
parent
d74025f4
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
5 deletions
+20
-5
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+2
-0
drawer.dart
packages/flutter/lib/src/material/drawer.dart
+2
-0
drop_down.dart
packages/flutter/lib/src/material/drop_down.dart
+3
-1
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+2
-0
material.dart
packages/flutter/lib/src/material/material.dart
+3
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+2
-0
raised_button.dart
packages/flutter/lib/src/material/raised_button.dart
+2
-0
shadows.dart
packages/flutter/lib/src/material/shadows.dart
+2
-1
switch.dart
packages/flutter/lib/src/material/switch.dart
+1
-1
box_test.dart
packages/flutter/test/rendering/box_test.dart
+1
-1
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
0d7b61f5
...
...
@@ -96,6 +96,8 @@ class AppBar extends StatelessWidget {
final
TabBar
<
dynamic
>
tabBar
;
/// The z-coordinate at which to place this app bar.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// The color to use for the the app bar's material.
...
...
packages/flutter/lib/src/material/drawer.dart
View file @
0d7b61f5
...
...
@@ -51,6 +51,8 @@ class Drawer extends StatelessWidget {
})
:
super
(
key:
key
);
/// The z-coordinate at which to place this drawer.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// The widget below this widget in the tree.
...
...
packages/flutter/lib/src/material/drop_down.dart
View file @
0d7b61f5
...
...
@@ -43,7 +43,7 @@ class _DropDownMenuPainter extends CustomPainter {
final
BoxPainter
painter
=
new
BoxDecoration
(
backgroundColor:
color
,
borderRadius:
2.0
,
boxShadow:
e
levationToShadow
[
elevation
]
boxShadow:
kE
levationToShadow
[
elevation
]
).
createBoxPainter
();
double
top
=
renderBox
.
globalToLocal
(
new
Point
(
0.0
,
menuTop
)).
y
;
...
...
@@ -310,6 +310,8 @@ class DropDownButton<T> extends StatefulWidget {
final
ValueChanged
<
T
>
onChanged
;
/// The z-coordinate at which to place the menu when open.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
@override
...
...
packages/flutter/lib/src/material/floating_action_button.dart
View file @
0d7b61f5
...
...
@@ -73,6 +73,8 @@ class FloatingActionButton extends StatefulWidget {
final
VoidCallback
onPressed
;
/// The z-coordinate at which to place this button.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// The z-coordinate at which to place this button when the user is touching the button.
...
...
packages/flutter/lib/src/material/material.dart
View file @
0d7b61f5
...
...
@@ -181,6 +181,8 @@ class Material extends StatefulWidget {
final
MaterialType
type
;
/// The z-coordinate at which to place this material.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// The color to paint the material.
...
...
@@ -266,7 +268,7 @@ class _MaterialState extends State<Material> {
duration:
kThemeChangeDuration
,
decoration:
new
BoxDecoration
(
borderRadius:
kMaterialEdges
[
config
.
type
],
boxShadow:
config
.
elevation
==
0
?
null
:
e
levationToShadow
[
config
.
elevation
],
boxShadow:
config
.
elevation
==
0
?
null
:
kE
levationToShadow
[
config
.
elevation
],
shape:
config
.
type
==
MaterialType
.
circle
?
BoxShape
.
circle
:
BoxShape
.
rectangle
),
child:
new
Container
(
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
0d7b61f5
...
...
@@ -417,6 +417,8 @@ class PopupMenuButton<T> extends StatefulWidget {
final
String
tooltip
;
/// The z-coordinate at which to place the menu when open.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// The widget below this widget in the tree.
...
...
packages/flutter/lib/src/material/raised_button.dart
View file @
0d7b61f5
...
...
@@ -57,6 +57,8 @@ class RaisedButton extends MaterialButton {
final
Color
disabledColor
;
/// The z-coordinate at which to place this button.
///
/// The following elevations have defined shadows: 1, 2, 3, 4, 6, 8, 9, 12, 16, 24
final
int
elevation
;
/// The z-coordinate at which to place this button when highlighted.
...
...
packages/flutter/lib/src/material/shadows.dart
View file @
0d7b61f5
...
...
@@ -18,9 +18,10 @@ import 'package:flutter/painting.dart';
/// effect for that elevation.
///
/// See also:
///
/// * [Material]
/// * <https://www.google.com/design/spec/what-is-material/elevation-shadows.html>
const
Map
<
int
,
List
<
BoxShadow
>>
e
levationToShadow
=
_elevationToShadow
;
// to hide the literal from the docs
const
Map
<
int
,
List
<
BoxShadow
>>
kE
levationToShadow
=
_elevationToShadow
;
// to hide the literal from the docs
const
Color
_kKeyUmbraOpacity
=
const
Color
(
0x33000000
);
// alpha = 0.2
const
Color
_kKeyPenumbraOpacity
=
const
Color
(
0x24000000
);
// alpha = 0.14
...
...
packages/flutter/lib/src/material/switch.dart
View file @
0d7b61f5
...
...
@@ -268,7 +268,7 @@ class _RenderSwitch extends RenderToggleable {
return
new
BoxDecoration
(
backgroundColor:
color
,
shape:
BoxShape
.
circle
,
boxShadow:
e
levationToShadow
[
1
]
boxShadow:
kE
levationToShadow
[
1
]
);
}
...
...
packages/flutter/test/rendering/box_test.dart
View file @
0d7b61f5
...
...
@@ -16,7 +16,7 @@ void main() {
gradient:
new
RadialGradient
(
center:
FractionalOffset
.
topLeft
,
radius:
1.8
,
colors:
<
Color
>[
Colors
.
yellow
[
500
],
Colors
.
blue
[
500
]]),
boxShadow:
e
levationToShadow
[
3
])
boxShadow:
kE
levationToShadow
[
3
])
);
layout
(
root
);
expect
(
root
.
size
.
width
,
equals
(
800.0
));
...
...
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