Revert "chagne the elevation from int to double (#82340)" (#82446)
This reverts commit 13a72114b239238ce7f8317efdbd242dfd276925.
diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart
index 696e51b..af79908 100644
--- a/packages/flutter/lib/src/material/dropdown.dart
+++ b/packages/flutter/lib/src/material/dropdown.dart
@@ -55,7 +55,7 @@
super(repaint: resize);
final Color? color;
- final double? elevation;
+ final int? elevation;
final int? selectedIndex;
final Animation<double> resize;
final ValueGetter<double> getSelectedItemOffset;
@@ -425,7 +425,7 @@
final EdgeInsetsGeometry padding;
final Rect buttonRect;
final int selectedIndex;
- final double elevation;
+ final int elevation;
final CapturedThemes capturedThemes;
final TextStyle style;
final double? itemHeight;
@@ -568,7 +568,7 @@
final EdgeInsetsGeometry padding;
final Rect buttonRect;
final int selectedIndex;
- final double elevation;
+ final int elevation;
final CapturedThemes capturedThemes;
final TextStyle? style;
final Color? dropdownColor;
@@ -997,8 +997,12 @@
final DropdownButtonBuilder? selectedItemBuilder;
/// 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, and 24. See [kElevationToShadow].
+ ///
/// Defaults to 8, the appropriate elevation for dropdown buttons.
- final double elevation;
+ final int elevation;
/// The text style to use for text in the dropdown button and the dropdown
/// menu that appears when you tap the button.
@@ -1536,7 +1540,7 @@
Widget? disabledHint,
this.onChanged,
VoidCallback? onTap,
- double elevation = 8,
+ int elevation = 8,
TextStyle? style,
Widget? icon,
Color? iconDisabledColor,
diff --git a/packages/flutter/test/material/dropdown_form_field_test.dart b/packages/flutter/test/material/dropdown_form_field_test.dart
index 3c4bb68..66883d6 100644
--- a/packages/flutter/test/material/dropdown_form_field_test.dart
+++ b/packages/flutter/test/material/dropdown_form_field_test.dart
@@ -27,7 +27,7 @@
Widget buildFormFrame({
Key? buttonKey,
AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
- double elevation = 8,
+ int elevation = 8,
String? value = 'two',
ValueChanged<String?>? onChanged,
VoidCallback? onTap,
@@ -125,7 +125,7 @@
State<TestApp> createState() => _TestAppState();
}
-void verifyPaintedShadow(Finder customPaint, double elevation) {
+void verifyPaintedShadow(Finder customPaint, int elevation) {
const Rect originalRectangle = Rect.fromLTRB(0.0, 0.0, 800, 208.0);
final List<BoxShadow> boxShadows = List<BoxShadow>.generate(3, (int index) => kElevationToShadow[elevation]![index]);
diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart
index 3c767d5..e502918 100644
--- a/packages/flutter/test/material/dropdown_test.dart
+++ b/packages/flutter/test/material/dropdown_test.dart
@@ -237,7 +237,7 @@
expect(box0.size, equals(box1.size));
}
-void verifyPaintedShadow(Finder customPaint, double elevation) {
+void verifyPaintedShadow(Finder customPaint, int elevation) {
const Rect originalRectangle = Rect.fromLTRB(0.0, 0.0, 800, 208.0);
final List<BoxShadow> boxShadows = List<BoxShadow>.generate(3, (int index) => kElevationToShadow[elevation]![index]);