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
4a9b687a
Unverified
Commit
4a9b687a
authored
Aug 02, 2019
by
MH Johnson
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Material] FAB refactor - remove unnecessary IconTheme (#37269)
* Remove unneeded IconTheme from FAB
parent
5df17acb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+2
-13
floating_action_button_test.dart
...es/flutter/test/material/floating_action_button_test.dart
+17
-0
No files found.
packages/flutter/lib/src/material/floating_action_button.dart
View file @
4a9b687a
...
@@ -431,18 +431,7 @@ class FloatingActionButton extends StatelessWidget {
...
@@ -431,18 +431,7 @@ class FloatingActionButton extends StatelessWidget {
??
floatingActionButtonTheme
.
shape
??
floatingActionButtonTheme
.
shape
??
(
isExtended
?
_defaultExtendedShape
:
_defaultShape
);
??
(
isExtended
?
_defaultExtendedShape
:
_defaultShape
);
Widget
result
;
Widget
result
=
RawMaterialButton
(
if
(
child
!=
null
)
{
result
=
IconTheme
.
merge
(
data:
IconThemeData
(
color:
foregroundColor
,
),
child:
child
,
);
}
result
=
RawMaterialButton
(
onPressed:
onPressed
,
onPressed:
onPressed
,
elevation:
elevation
,
elevation:
elevation
,
focusElevation:
focusElevation
,
focusElevation:
focusElevation
,
...
@@ -458,7 +447,7 @@ class FloatingActionButton extends StatelessWidget {
...
@@ -458,7 +447,7 @@ class FloatingActionButton extends StatelessWidget {
shape:
shape
,
shape:
shape
,
clipBehavior:
clipBehavior
??
Clip
.
none
,
clipBehavior:
clipBehavior
??
Clip
.
none
,
focusNode:
focusNode
,
focusNode:
focusNode
,
child:
result
,
child:
child
,
);
);
if
(
tooltip
!=
null
)
{
if
(
tooltip
!=
null
)
{
...
...
packages/flutter/test/material/floating_action_button_test.dart
View file @
4a9b687a
...
@@ -781,6 +781,23 @@ void main() {
...
@@ -781,6 +781,23 @@ void main() {
),
),
);
);
},
semanticsEnabled:
true
);
},
semanticsEnabled:
true
);
testWidgets
(
'Foreground color applies to icon on fab'
,
(
WidgetTester
tester
)
async
{
const
Color
foregroundColor
=
Color
(
0xcafefeed
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
FloatingActionButton
(
onPressed:
()
{},
foregroundColor:
foregroundColor
,
child:
const
Icon
(
Icons
.
access_alarm
),
),
));
final
RichText
iconRichText
=
tester
.
widget
<
RichText
>(
find
.
descendant
(
of:
find
.
byIcon
(
Icons
.
access_alarm
),
matching:
find
.
byType
(
RichText
)),
);
expect
(
iconRichText
.
text
.
style
.
color
,
foregroundColor
);
});
}
}
Offset
_rightEdgeOfFab
(
WidgetTester
tester
)
{
Offset
_rightEdgeOfFab
(
WidgetTester
tester
)
{
...
...
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