diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index dfd569a341..4b07f445a4 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -96,6 +96,8 @@ class AppBar extends StatelessWidget { final TabBar 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. diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart index 6d7990762a..d887181e45 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -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. diff --git a/packages/flutter/lib/src/material/drop_down.dart b/packages/flutter/lib/src/material/drop_down.dart index 909cf0e9f3..41e5839bd7 100644 --- a/packages/flutter/lib/src/material/drop_down.dart +++ b/packages/flutter/lib/src/material/drop_down.dart @@ -43,7 +43,7 @@ class _DropDownMenuPainter extends CustomPainter { final BoxPainter painter = new BoxDecoration( backgroundColor: color, borderRadius: 2.0, - boxShadow: elevationToShadow[elevation] + boxShadow: kElevationToShadow[elevation] ).createBoxPainter(); double top = renderBox.globalToLocal(new Point(0.0, menuTop)).y; @@ -310,6 +310,8 @@ class DropDownButton extends StatefulWidget { final ValueChanged 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 diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index f0defa8758..62e8103fd9 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -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. diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index 35adf89921..f960ac07e6 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -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 { duration: kThemeChangeDuration, decoration: new BoxDecoration( borderRadius: kMaterialEdges[config.type], - boxShadow: config.elevation == 0 ? null : elevationToShadow[config.elevation], + boxShadow: config.elevation == 0 ? null : kElevationToShadow[config.elevation], shape: config.type == MaterialType.circle ? BoxShape.circle : BoxShape.rectangle ), child: new Container( diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index 246558e815..1db9b645ca 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -417,6 +417,8 @@ class PopupMenuButton 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. diff --git a/packages/flutter/lib/src/material/raised_button.dart b/packages/flutter/lib/src/material/raised_button.dart index 4e514e8c07..9c0ca467da 100644 --- a/packages/flutter/lib/src/material/raised_button.dart +++ b/packages/flutter/lib/src/material/raised_button.dart @@ -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. diff --git a/packages/flutter/lib/src/material/shadows.dart b/packages/flutter/lib/src/material/shadows.dart index b10bce107a..9831051362 100644 --- a/packages/flutter/lib/src/material/shadows.dart +++ b/packages/flutter/lib/src/material/shadows.dart @@ -18,9 +18,10 @@ import 'package:flutter/painting.dart'; /// effect for that elevation. /// /// See also: +/// /// * [Material] /// * -const Map> elevationToShadow = _elevationToShadow; // to hide the literal from the docs +const Map> kElevationToShadow = _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 diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart index 4d1edd36d3..0cb1879433 100644 --- a/packages/flutter/lib/src/material/switch.dart +++ b/packages/flutter/lib/src/material/switch.dart @@ -268,7 +268,7 @@ class _RenderSwitch extends RenderToggleable { return new BoxDecoration( backgroundColor: color, shape: BoxShape.circle, - boxShadow: elevationToShadow[1] + boxShadow: kElevationToShadow[1] ); } diff --git a/packages/flutter/test/rendering/box_test.dart b/packages/flutter/test/rendering/box_test.dart index 2e335cdb00..20ba2f94b2 100644 --- a/packages/flutter/test/rendering/box_test.dart +++ b/packages/flutter/test/rendering/box_test.dart @@ -16,7 +16,7 @@ void main() { gradient: new RadialGradient( center: FractionalOffset.topLeft, radius: 1.8, colors: [Colors.yellow[500], Colors.blue[500]]), - boxShadow: elevationToShadow[3]) + boxShadow: kElevationToShadow[3]) ); layout(root); expect(root.size.width, equals(800.0));