From 74d403a2d64b913266c981fea11ea6611085392a Mon Sep 17 00:00:00 2001 From: Abhishek Ghaskata Date: Mon, 3 May 2021 21:54:02 +0530 Subject: [PATCH] Change elevation to double of MergeableMaterial (#81634) --- packages/flutter/lib/src/material/expansion_panel.dart | 2 +- packages/flutter/lib/src/material/mergeable_material.dart | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index 5e33d627f2..069e2867c1 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -560,7 +560,7 @@ class _ExpansionPanelListState extends State { return MergeableMaterial( hasDividers: true, dividerColor: widget.dividerColor, - elevation: widget.elevation, + elevation: widget.elevation.toDouble(), children: items, ); } diff --git a/packages/flutter/lib/src/material/mergeable_material.dart b/packages/flutter/lib/src/material/mergeable_material.dart index c05252887c..391c4431ea 100644 --- a/packages/flutter/lib/src/material/mergeable_material.dart +++ b/packages/flutter/lib/src/material/mergeable_material.dart @@ -123,8 +123,7 @@ class MergeableMaterial extends StatefulWidget { /// The z-coordinate at which to place all the [Material] slices. /// /// Defaults to 2, the appropriate elevation for cards. - // TODO(ianh): Change this to double. - final int elevation; + final double elevation; /// Whether connected pieces of [MaterialSlice] have dividers between them. final bool hasDividers; @@ -139,7 +138,7 @@ class MergeableMaterial extends StatefulWidget { void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); properties.add(EnumProperty('mainAxis', mainAxis)); - properties.add(DoubleProperty('elevation', elevation.toDouble())); + properties.add(DoubleProperty('elevation', elevation)); } @override @@ -616,7 +615,7 @@ class _MergeableMaterialState extends State with TickerProvid return _MergeableMaterialListBody( mainAxis: widget.mainAxis, - elevation: widget.elevation.toDouble(), + elevation: widget.elevation, items: _children, children: widgets, );