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
6f002abc
Unverified
Commit
6f002abc
authored
Jan 11, 2021
by
Hans Muller
Committed by
GitHub
Jan 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Prevent text from overflowing in OutlineButton and OutlinedButton label. (#70872)" (#73715)
parent
89197a66
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
34 deletions
+2
-34
outline_button.dart
packages/flutter/lib/src/material/outline_button.dart
+1
-1
outlined_button.dart
packages/flutter/lib/src/material/outlined_button.dart
+1
-1
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+0
-16
outlined_button_test.dart
packages/flutter/test/material/outlined_button_test.dart
+0
-16
No files found.
packages/flutter/lib/src/material/outline_button.dart
View file @
6f002abc
...
@@ -266,7 +266,7 @@ class _OutlineButtonWithIcon extends OutlineButton with MaterialButtonWithIconMi
...
@@ -266,7 +266,7 @@ class _OutlineButtonWithIcon extends OutlineButton with MaterialButtonWithIconMi
children:
<
Widget
>[
children:
<
Widget
>[
icon
,
icon
,
const
SizedBox
(
width:
8.0
),
const
SizedBox
(
width:
8.0
),
Flexible
(
child:
label
)
,
label
,
],
],
),
),
);
);
...
...
packages/flutter/lib/src/material/outlined_button.dart
View file @
6f002abc
...
@@ -345,7 +345,7 @@ class _OutlinedButtonWithIconChild extends StatelessWidget {
...
@@ -345,7 +345,7 @@ class _OutlinedButtonWithIconChild extends StatelessWidget {
final
double
gap
=
scale
<=
1
?
8
:
lerpDouble
(
8
,
4
,
math
.
min
(
scale
-
1
,
1
))!;
final
double
gap
=
scale
<=
1
?
8
:
lerpDouble
(
8
,
4
,
math
.
min
(
scale
-
1
,
1
))!;
return
Row
(
return
Row
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
Flexible
(
child:
label
)
],
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
label
],
);
);
}
}
}
}
packages/flutter/test/material/outline_button_test.dart
View file @
6f002abc
...
@@ -1222,22 +1222,6 @@ void main() {
...
@@ -1222,22 +1222,6 @@ void main() {
expect
(
box
.
size
,
equals
(
const
Size
(
76
,
36
)));
expect
(
box
.
size
,
equals
(
const
Size
(
76
,
36
)));
expect
(
childRect
,
equals
(
const
Rect
.
fromLTRB
(
372.0
,
293.0
,
428.0
,
307.0
)));
expect
(
childRect
,
equals
(
const
Rect
.
fromLTRB
(
372.0
,
293.0
,
428.0
,
307.0
)));
});
});
testWidgets
(
'Text does not overflow in OutlineButton label'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
MouseRegion
(
cursor:
SystemMouseCursors
.
forbidden
,
child:
OutlineButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'this is a very long text used to check whether an overflow occurs or not'
),
onPressed:
()
{},
),
),
),
);
});
}
}
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
...
...
packages/flutter/test/material/outlined_button_test.dart
View file @
6f002abc
...
@@ -1212,22 +1212,6 @@ void main() {
...
@@ -1212,22 +1212,6 @@ void main() {
);
);
expect
(
paddingWidget
.
padding
,
const
EdgeInsets
.
all
(
22
));
expect
(
paddingWidget
.
padding
,
const
EdgeInsets
.
all
(
22
));
});
});
testWidgets
(
'Text does not overflow in OutlinedButton label'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
MouseRegion
(
cursor:
SystemMouseCursors
.
forbidden
,
child:
OutlinedButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'this is a very long text used to check whether an overflow occurs or not'
),
onPressed:
()
{},
),
),
),
);
});
}
}
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
...
...
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