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
c5f61ac3
Commit
c5f61ac3
authored
Dec 10, 2019
by
Taufiq Rahman
Committed by
Shi-Hao Hong
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: `ExpandIcon` should use the `size` parameter (#45712)
* ExpandIcon should use the size parameter
parent
4938ea03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
expand_icon.dart
packages/flutter/lib/src/material/expand_icon.dart
+1
-0
expand_icon_test.dart
packages/flutter/test/material/expand_icon_test.dart
+39
-0
No files found.
packages/flutter/lib/src/material/expand_icon.dart
View file @
c5f61ac3
...
...
@@ -177,6 +177,7 @@ class _ExpandIconState extends State<ExpandIcon> with SingleTickerProviderStateM
onTapHint:
widget
.
onPressed
==
null
?
null
:
onTapHint
,
child:
IconButton
(
padding:
widget
.
padding
,
iconSize:
widget
.
size
,
color:
_iconColor
,
disabledColor:
widget
.
disabledColor
,
onPressed:
widget
.
onPressed
==
null
?
null
:
_handlePressed
,
...
...
packages/flutter/test/material/expand_icon_test.dart
View file @
c5f61ac3
...
...
@@ -134,6 +134,45 @@ void main() {
expect
(
rotation
.
turns
.
value
,
0.5
);
});
testWidgets
(
'ExpandIcon default size is 24'
,
(
WidgetTester
tester
)
async
{
final
ExpandIcon
expandIcon
=
ExpandIcon
(
onPressed:
(
bool
isExpanded
)
{},
);
await
tester
.
pumpWidget
(
wrap
(
child:
expandIcon
));
final
ExpandIcon
icon
=
tester
.
firstWidget
(
find
.
byWidget
(
expandIcon
));
expect
(
icon
.
size
,
24
);
});
testWidgets
(
'ExpandIcon has the correct given size'
,
(
WidgetTester
tester
)
async
{
ExpandIcon
expandIcon
=
ExpandIcon
(
size:
36
,
onPressed:
(
bool
isExpanded
)
{},
);
await
tester
.
pumpWidget
(
wrap
(
child:
expandIcon
));
ExpandIcon
icon
=
tester
.
firstWidget
(
find
.
byWidget
(
expandIcon
));
expect
(
icon
.
size
,
36
);
expandIcon
=
ExpandIcon
(
size:
48
,
onPressed:
(
bool
isExpanded
)
{},
);
await
tester
.
pumpWidget
(
wrap
(
child:
expandIcon
));
icon
=
tester
.
firstWidget
(
find
.
byWidget
(
expandIcon
));
expect
(
icon
.
size
,
48
);
});
testWidgets
(
'ExpandIcon has correct semantic hints'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
const
DefaultMaterialLocalizations
localizations
=
DefaultMaterialLocalizations
();
...
...
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