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
fdc3fb3f
Unverified
Commit
fdc3fb3f
authored
Jun 14, 2021
by
Abhishek Ghaskata
Committed by
GitHub
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Elevation for Stepper(horizontally) (#83177)
parent
ec5cfc00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
stepper.dart
packages/flutter/lib/src/material/stepper.dart
+5
-1
stepper_test.dart
packages/flutter/test/material/stepper_test.dart
+66
-0
No files found.
packages/flutter/lib/src/material/stepper.dart
View file @
fdc3fb3f
...
...
@@ -185,6 +185,7 @@ class Stepper extends StatefulWidget {
this
.
onStepContinue
,
this
.
onStepCancel
,
this
.
controlsBuilder
,
this
.
elevation
,
})
:
assert
(
steps
!=
null
),
assert
(
type
!=
null
),
assert
(
currentStep
!=
null
),
...
...
@@ -280,6 +281,9 @@ class Stepper extends StatefulWidget {
/// {@end-tool}
final
ControlsWidgetBuilder
?
controlsBuilder
;
/// The elevation of this stepper's [Material] when [type] is [StepperType.horizontal].
final
double
?
elevation
;
@override
State
<
Stepper
>
createState
()
=>
_StepperState
();
}
...
...
@@ -697,7 +701,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
return
Column
(
children:
<
Widget
>[
Material
(
elevation:
2.0
,
elevation:
widget
.
elevation
??
2
,
child:
Container
(
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
),
child:
Row
(
...
...
packages/flutter/test/material/stepper_test.dart
View file @
fdc3fb3f
...
...
@@ -887,4 +887,70 @@ void main() {
await
tester
.
pumpAndSettle
();
expect
(
circleFillColor
(),
dark
.
background
);
});
testWidgets
(
'Stepper custom elevation'
,
(
WidgetTester
tester
)
async
{
const
double
elevation
=
4.0
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
SizedBox
(
width:
200
,
height:
75
,
child:
Stepper
(
type:
StepperType
.
horizontal
,
elevation:
elevation
,
steps:
const
<
Step
>[
Step
(
title:
Text
(
'Regular title'
),
content:
Text
(
'Text content'
),
),
],
),
),
),
),
);
final
Material
material
=
tester
.
firstWidget
<
Material
>(
find
.
descendant
(
of:
find
.
byType
(
Stepper
),
matching:
find
.
byType
(
Material
),
),
);
expect
(
material
.
elevation
,
elevation
);
});
testWidgets
(
'Stepper with default elevation'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
SizedBox
(
width:
200
,
height:
75
,
child:
Stepper
(
type:
StepperType
.
horizontal
,
steps:
const
<
Step
>[
Step
(
title:
Text
(
'Regular title'
),
content:
Text
(
'Text content'
)
),
],
),
),
),
),
);
final
Material
material
=
tester
.
firstWidget
<
Material
>(
find
.
descendant
(
of:
find
.
byType
(
Stepper
),
matching:
find
.
byType
(
Material
),
),
);
expect
(
material
.
elevation
,
2.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