ExpansionPanelList elevation as double (#81813)

This commit is contained in:
Abhishek Ghaskata 2021-05-12 05:29:03 +05:30 committed by GitHub
parent 212e3f4e2e
commit 38840b41a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View file

@ -380,14 +380,8 @@ class ExpansionPanelList extends StatefulWidget {
/// Defines elevation for the [ExpansionPanel] while it's expanded. /// Defines elevation for the [ExpansionPanel] while it's expanded.
/// ///
/// This uses [kElevationToShadow] to simulate shadows, it does not use
/// [Material]'s arbitrary elevation feature.
///
/// The following values can be used to define the elevation: 0, 1, 2, 3, 4, 6,
/// 8, 9, 12, 16, 24.
///
/// By default, the value of elevation is 2. /// By default, the value of elevation is 2.
final int elevation; final double elevation;
@override @override
State<StatefulWidget> createState() => _ExpansionPanelListState(); State<StatefulWidget> createState() => _ExpansionPanelListState();
@ -560,7 +554,7 @@ class _ExpansionPanelListState extends State<ExpansionPanelList> {
return MergeableMaterial( return MergeableMaterial(
hasDividers: true, hasDividers: true,
dividerColor: widget.dividerColor, dividerColor: widget.dividerColor,
elevation: widget.elevation.toDouble(), elevation: widget.elevation,
children: items, children: items,
); );
} }

View file

@ -20,7 +20,7 @@ class SimpleExpansionPanelListTestWidget extends StatefulWidget {
final Key? secondPanelKey; final Key? secondPanelKey;
final bool canTapOnHeader; final bool canTapOnHeader;
final Color? dividerColor; final Color? dividerColor;
final int elevation; final double elevation;
/// If null, the default [ExpansionPanelList]'s expanded header padding value is applied via [defaultExpandedHeaderPadding] /// If null, the default [ExpansionPanelList]'s expanded header padding value is applied via [defaultExpandedHeaderPadding]
final EdgeInsets? expandedHeaderPadding; final EdgeInsets? expandedHeaderPadding;
@ -1397,7 +1397,7 @@ void main() {
}); });
testWidgets('elevation is propagated properly to MergeableMaterial', (WidgetTester tester) async { testWidgets('elevation is propagated properly to MergeableMaterial', (WidgetTester tester) async {
const int _elevation = 8; const double _elevation = 8;
// Test for ExpansionPanelList. // Test for ExpansionPanelList.
await tester.pumpWidget(const MaterialApp( await tester.pumpWidget(const MaterialApp(