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
6a080aa9
Unverified
Commit
6a080aa9
authored
Apr 03, 2018
by
Hans Muller
Committed by
GitHub
Apr 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ExtendedFloatingActionButton width (#16168)
parent
0a4c1166
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
floating_action_button.dart
...ages/flutter/lib/src/material/floating_action_button.dart
+5
-6
floating_action_button_test.dart
...es/flutter/test/material/floating_action_button_test.dart
+11
-1
No files found.
packages/flutter/lib/src/material/floating_action_button.dart
View file @
6a080aa9
...
...
@@ -254,14 +254,13 @@ class _FloatingActionButtonState extends State<FloatingActionButton> {
}
if
(
widget
.
tooltip
!=
null
)
{
final
Widget
tooltip
=
new
Tooltip
(
message:
widget
.
tooltip
,
child:
result
,
);
// The long-pressable area for the tooltip should always be as big as
// the tooltip even if there is no child.
result
=
new
SizedBox
.
expand
(
child:
new
Tooltip
(
message:
widget
.
tooltip
,
child:
result
,
),
);
result
=
widget
.
child
!=
null
?
tooltip
:
new
SizedBox
.
expand
(
child:
tooltip
);
}
result
=
new
RawMaterialButton
(
...
...
packages/flutter/test/material/floating_action_button_test.dart
View file @
6a080aa9
...
...
@@ -91,7 +91,10 @@ void main() {
new
MaterialApp
(
home:
new
Scaffold
(
floatingActionButton:
new
FloatingActionButton
.
extended
(
label:
const
Text
(
'label'
),
label:
const
SizedBox
(
width:
100.0
,
child:
const
Text
(
'label'
),
),
icon:
const
Icon
(
Icons
.
android
),
onPressed:
null
,
),
...
...
@@ -107,6 +110,7 @@ void main() {
// Verify that the widget's height is 48 and that its internal
/// horizontal layout is: 16 icon 8 label 20
expect
(
tester
.
getSize
(
fabFinder
).
height
,
48.0
);
final
double
fabLeft
=
tester
.
getTopLeft
(
fabFinder
).
dx
;
final
double
fabRight
=
tester
.
getTopRight
(
fabFinder
).
dx
;
final
double
iconLeft
=
tester
.
getTopLeft
(
find
.
byType
(
Icon
)).
dx
;
...
...
@@ -116,6 +120,12 @@ void main() {
expect
(
iconLeft
-
fabLeft
,
16.0
);
expect
(
labelLeft
-
iconRight
,
8.0
);
expect
(
fabRight
-
labelRight
,
20.0
);
// The overall width of the button is:
// 168 = 16 + 24(icon) + 8 + 100(label) + 20
expect
(
tester
.
getSize
(
find
.
byType
(
Icon
)).
width
,
24.0
);
expect
(
tester
.
getSize
(
find
.
text
(
'label'
)).
width
,
100.0
);
expect
(
tester
.
getSize
(
fabFinder
).
width
,
168
);
});
testWidgets
(
'Floating Action Button heroTag'
,
(
WidgetTester
tester
)
async
{
...
...
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