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
720dac54
Unverified
Commit
720dac54
authored
Mar 23, 2021
by
Hans Muller
Committed by
GitHub
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fixed Buttons with icon RenderFlex overflow (#78018)" (#78825)
parent
6952c1cf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
6 additions
and
126 deletions
+6
-126
elevated_button.dart
packages/flutter/lib/src/material/elevated_button.dart
+1
-1
flat_button.dart
packages/flutter/lib/src/material/flat_button.dart
+1
-1
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
raised_button.dart
packages/flutter/lib/src/material/raised_button.dart
+1
-1
text_button.dart
packages/flutter/lib/src/material/text_button.dart
+1
-1
elevated_button_test.dart
packages/flutter/test/material/elevated_button_test.dart
+0
-20
flat_button_test.dart
packages/flutter/test/material/flat_button_test.dart
+0
-20
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+0
-20
outlined_button_test.dart
packages/flutter/test/material/outlined_button_test.dart
+0
-20
raised_button_test.dart
packages/flutter/test/material/raised_button_test.dart
+0
-20
text_button_test.dart
packages/flutter/test/material/text_button_test.dart
+0
-20
No files found.
packages/flutter/lib/src/material/elevated_button.dart
View file @
720dac54
...
...
@@ -468,7 +468,7 @@ class _ElevatedButtonWithIconChild extends StatelessWidget {
final
double
gap
=
scale
<=
1
?
8
:
lerpDouble
(
8
,
4
,
math
.
min
(
scale
-
1
,
1
))!;
return
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
Flexible
(
child:
label
)
],
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
label
],
);
}
}
packages/flutter/lib/src/material/flat_button.dart
View file @
720dac54
...
...
@@ -229,7 +229,7 @@ class _FlatButtonWithIcon extends FlatButton with MaterialButtonWithIconMixin {
children:
<
Widget
>[
icon
,
const
SizedBox
(
width:
8.0
),
Flexible
(
child:
label
)
,
label
,
],
),
minWidth:
minWidth
,
...
...
packages/flutter/lib/src/material/outline_button.dart
View file @
720dac54
...
...
@@ -274,7 +274,7 @@ class _OutlineButtonWithIcon extends OutlineButton with MaterialButtonWithIconMi
children:
<
Widget
>[
icon
,
const
SizedBox
(
width:
8.0
),
Flexible
(
child:
label
)
,
label
,
],
),
);
...
...
packages/flutter/lib/src/material/outlined_button.dart
View file @
720dac54
...
...
@@ -374,7 +374,7 @@ class _OutlinedButtonWithIconChild extends StatelessWidget {
final
double
gap
=
scale
<=
1
?
8
:
lerpDouble
(
8
,
4
,
math
.
min
(
scale
-
1
,
1
))!;
return
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
Flexible
(
child:
label
)
],
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
label
],
);
}
}
packages/flutter/lib/src/material/raised_button.dart
View file @
720dac54
...
...
@@ -265,7 +265,7 @@ class _RaisedButtonWithIcon extends RaisedButton with MaterialButtonWithIconMixi
children:
<
Widget
>[
icon
,
const
SizedBox
(
width:
8.0
),
Flexible
(
child:
label
)
,
label
,
],
),
);
...
...
packages/flutter/lib/src/material/text_button.dart
View file @
720dac54
...
...
@@ -465,7 +465,7 @@ class _TextButtonWithIconChild extends StatelessWidget {
final
double
gap
=
scale
<=
1
?
8
:
lerpDouble
(
8
,
4
,
math
.
min
(
scale
-
1
,
1
))!;
return
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
Flexible
(
child:
label
)
],
children:
<
Widget
>[
icon
,
SizedBox
(
width:
gap
),
label
],
);
}
}
packages/flutter/test/material/elevated_button_test.dart
View file @
720dac54
...
...
@@ -1114,26 +1114,6 @@ void main() {
await
tester
.
pumpAndSettle
();
}
});
testWidgets
(
'Fixed ElevatedButton.icon RenderFlex overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SizedBox
(
width:
200
,
child:
ElevatedButton
.
icon
(
onPressed:
()
{},
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a euismod nibh. Morbi laoreet purus.'
,
),
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
TextStyle
_iconStyle
(
WidgetTester
tester
,
IconData
icon
)
{
...
...
packages/flutter/test/material/flat_button_test.dart
View file @
720dac54
...
...
@@ -882,26 +882,6 @@ void main() {
await
buildWidget
(
buttonMinWidth:
buttonMinWidth
);
expect
(
tester
.
widget
<
RawMaterialButton
>(
rawMaterialButtonFinder
).
constraints
.
minWidth
,
buttonMinWidth
);
});
testWidgets
(
'Fixed FlatButton.icon RenderFlex overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SizedBox
(
width:
200
,
child:
FlatButton
.
icon
(
onPressed:
()
{},
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a euismod nibh. Morbi laoreet purus.'
,
),
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
TextStyle
?
_iconStyle
(
WidgetTester
tester
,
IconData
icon
)
{
...
...
packages/flutter/test/material/outline_button_test.dart
View file @
720dac54
...
...
@@ -1222,26 +1222,6 @@ void main() {
expect
(
box
.
size
,
equals
(
const
Size
(
76
,
36
)));
expect
(
childRect
,
equals
(
const
Rect
.
fromLTRB
(
372.0
,
293.0
,
428.0
,
307.0
)));
});
testWidgets
(
'Fixed OutlineButton.icon RenderFlex overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SizedBox
(
width:
200
,
child:
OutlineButton
.
icon
(
onPressed:
()
{},
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a euismod nibh. Morbi laoreet purus.'
,
),
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
...
...
packages/flutter/test/material/outlined_button_test.dart
View file @
720dac54
...
...
@@ -1290,26 +1290,6 @@ void main() {
await
tester
.
pumpAndSettle
();
}
});
testWidgets
(
'Fixed OutlinedButton.icon RenderFlex overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SizedBox
(
width:
200
,
child:
OutlinedButton
.
icon
(
onPressed:
()
{},
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a euismod nibh. Morbi laoreet purus.'
,
),
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
PhysicalModelLayer
_findPhysicalLayer
(
Element
element
)
{
...
...
packages/flutter/test/material/raised_button_test.dart
View file @
720dac54
...
...
@@ -727,26 +727,6 @@ void main() {
expect
(
paddingRect
.
top
,
tallerWidget
.
top
-
5
);
expect
(
paddingRect
.
bottom
,
tallerWidget
.
bottom
+
12
);
});
testWidgets
(
'Fixed RaisedButton.icon RenderFlex overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SizedBox
(
width:
200
,
child:
RaisedButton
.
icon
(
onPressed:
()
{},
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a euismod nibh. Morbi laoreet purus.'
,
),
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
TextStyle
_iconStyle
(
WidgetTester
tester
,
IconData
icon
)
{
...
...
packages/flutter/test/material/text_button_test.dart
View file @
720dac54
...
...
@@ -1087,26 +1087,6 @@ void main() {
await
tester
.
pumpAndSettle
();
}
});
testWidgets
(
'Fixed TextButton.icon RenderFlex overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
SizedBox
(
width:
200
,
child:
TextButton
.
icon
(
onPressed:
()
{},
icon:
const
Icon
(
Icons
.
add
),
label:
const
Text
(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a euismod nibh. Morbi laoreet purus.'
,
),
),
),
),
),
);
expect
(
tester
.
takeException
(),
null
);
});
}
TextStyle
?
_iconStyle
(
WidgetTester
tester
,
IconData
icon
)
{
...
...
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