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
26d4e927
Unverified
Commit
26d4e927
authored
Feb 08, 2022
by
Viren Khatri
Committed by
GitHub
Feb 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removes Material (#96899)
parent
a6504ead
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
410 additions
and
528 deletions
+410
-528
elevated_button_test.dart
packages/flutter/test/material/elevated_button_test.dart
+78
-96
flat_button_test.dart
packages/flutter/test/material/flat_button_test.dart
+35
-49
floating_action_button_test.dart
...es/flutter/test/material/floating_action_button_test.dart
+3
-5
material_button_test.dart
packages/flutter/test/material/material_button_test.dart
+38
-50
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+51
-69
outlined_button_test.dart
packages/flutter/test/material/outlined_button_test.dart
+91
-111
raised_button_test.dart
packages/flutter/test/material/raised_button_test.dart
+25
-35
text_button_test.dart
packages/flutter/test/material/text_button_test.dart
+89
-113
No files found.
packages/flutter/test/material/elevated_button_test.dart
View file @
26d4e927
...
...
@@ -419,8 +419,7 @@ void main() {
final
GlobalKey
childKey
=
GlobalKey
();
bool
hovering
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SizedBox
(
width:
100
,
...
...
@@ -435,7 +434,6 @@ void main() {
),
),
),
),
);
await
tester
.
pumpAndSettle
();
expect
(
focusNode
.
hasPrimaryFocus
,
isTrue
);
...
...
@@ -447,8 +445,7 @@ void main() {
expect
(
hovering
,
isTrue
);
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SizedBox
(
width:
100
,
...
...
@@ -461,7 +458,6 @@ void main() {
),
),
),
),
);
await
tester
.
pumpAndSettle
();
...
...
@@ -473,8 +469,7 @@ void main() {
late
bool
hover
;
Widget
buildFrame
({
required
bool
enabled
})
{
return
Material
(
child:
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
SizedBox
(
...
...
@@ -490,7 +485,6 @@ void main() {
),
),
),
),
);
}
...
...
@@ -537,8 +531,7 @@ void main() {
final
FocusNode
node
=
FocusNode
(
debugLabel:
'ElevatedButton Focus'
);
bool
gotFocus
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
ElevatedButton
(
focusNode:
node
,
...
...
@@ -547,7 +540,6 @@ void main() {
child:
const
SizedBox
(),
),
),
),
);
node
.
requestFocus
();
...
...
@@ -568,8 +560,7 @@ void main() {
final
FocusNode
node
=
FocusNode
(
debugLabel:
'ElevatedButton Focus'
);
bool
gotFocus
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
ElevatedButton
(
focusNode:
node
,
...
...
@@ -578,7 +569,6 @@ void main() {
child:
const
SizedBox
(),
),
),
),
);
node
.
requestFocus
();
...
...
@@ -681,7 +671,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
ElevatedButton
(
style:
ButtonStyle
(
...
...
@@ -695,7 +684,6 @@ void main() {
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
...
...
@@ -736,7 +724,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
tapTargetSize
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
ElevatedButton
(
key:
key
,
...
...
@@ -746,7 +733,6 @@ void main() {
),
),
),
),
);
}
...
...
@@ -763,13 +749,11 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
ElevatedButton
(
onPressed:
()
{
/* to make sure the button is enabled */
},
child:
const
Text
(
'button'
),
),
),
),
);
expect
(
...
...
@@ -855,7 +839,6 @@ void main() {
// horizontal padding is applied correctly later on
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
ElevatedButton
.
icon
(
key:
buttonKey
,
...
...
@@ -871,7 +854,6 @@ void main() {
),
),
),
),
);
final
Rect
paddingRect
=
tester
.
getRect
(
find
.
byType
(
Padding
));
...
...
packages/flutter/test/material/flat_button_test.dart
View file @
26d4e927
...
...
@@ -395,13 +395,11 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
FlatButton
(
child:
Container
(),
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
),
);
expect
(
...
...
@@ -536,7 +534,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
FlatButton
(
onPressed:
()
{
},
...
...
@@ -544,7 +541,6 @@ void main() {
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
...
...
@@ -576,7 +572,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(),
child:
Center
(
...
...
@@ -587,7 +582,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)),
equals
(
const
Size
(
88.0
,
48.0
)));
...
...
@@ -597,7 +591,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
1.3
),
child:
Center
(
...
...
@@ -608,7 +601,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)),
equals
(
const
Size
(
88.0
,
48.0
)));
...
...
@@ -621,7 +613,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
3.0
),
child:
Center
(
...
...
@@ -632,7 +623,6 @@ void main() {
),
),
),
),
);
// Scaled text rendering is different on Linux and Mac by one pixel.
...
...
@@ -650,7 +640,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
padded
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
FlatButton
(
key:
key1
,
...
...
@@ -660,7 +649,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key1
)),
const
Size
(
88.0
,
48.0
));
...
...
@@ -671,7 +659,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
FlatButton
(
key:
key2
,
...
...
@@ -681,7 +668,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key2
)),
const
Size
(
88.0
,
36.0
));
...
...
packages/flutter/test/material/floating_action_button_test.dart
View file @
26d4e927
...
...
@@ -897,13 +897,11 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
FloatingActionButton
(
focusNode:
focusNode
,
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
),
);
focusNode
.
unfocus
();
...
...
packages/flutter/test/material/material_button_test.dart
View file @
26d4e927
...
...
@@ -431,15 +431,13 @@ void main() {
const
Color
directSplashColor
=
Color
(
0xFF000011
);
const
Color
directHighlightColor
=
Color
(
0xFF000011
);
Widget
buttonWidget
=
Material
(
child:
Center
(
Widget
buttonWidget
=
Center
(
child:
MaterialButton
(
splashColor:
directSplashColor
,
highlightColor:
directHighlightColor
,
onPressed:
()
{
/* to make sure the button is enabled */
},
clipBehavior:
Clip
.
antiAlias
,
),
),
);
await
tester
.
pumpWidget
(
...
...
@@ -459,14 +457,16 @@ void main() {
await
tester
.
pump
();
// start gesture
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
// wait for splash to be well under way
const
Rect
expectedClipRect
=
Rect
.
fromLTRB
(
356.0
,
282.0
,
444.0
,
318.0
);
// Painter is translated to the center by the Center widget and not
// the Material widget.
const
Rect
expectedClipRect
=
Rect
.
fromLTRB
(
0.0
,
0.0
,
88.0
,
36.0
);
final
Path
expectedClipPath
=
Path
()
..
addRRect
(
RRect
.
fromRectAndRadius
(
expectedClipRect
,
const
Radius
.
circular
(
2.0
),
));
expect
(
Material
.
of
(
tester
.
element
(
find
.
byType
(
MaterialButton
))),
Material
.
of
(
tester
.
element
(
find
.
byType
(
InkWell
))),
paints
..
clipPath
(
pathMatcher:
coversSameAreaAs
(
expectedClipPath
,
...
...
@@ -479,13 +479,11 @@ void main() {
const
Color
themeSplashColor1
=
Color
(
0xFF001100
);
const
Color
themeHighlightColor1
=
Color
(
0xFF001100
);
buttonWidget
=
Material
(
child:
Center
(
buttonWidget
=
Center
(
child:
MaterialButton
(
onPressed:
()
{
/* to make sure the button is enabled */
},
clipBehavior:
Clip
.
antiAlias
,
),
),
);
await
tester
.
pumpWidget
(
...
...
@@ -503,7 +501,7 @@ void main() {
);
expect
(
Material
.
of
(
tester
.
element
(
find
.
byType
(
MaterialButton
))),
Material
.
of
(
tester
.
element
(
find
.
byType
(
InkWell
))),
paints
..
clipPath
(
pathMatcher:
coversSameAreaAs
(
expectedClipPath
,
...
...
@@ -531,7 +529,7 @@ void main() {
);
expect
(
Material
.
of
(
tester
.
element
(
find
.
byType
(
MaterialButton
))),
Material
.
of
(
tester
.
element
(
find
.
byType
(
InkWell
))),
paints
..
circle
(
color:
themeSplashColor2
)
..
rect
(
color:
themeHighlightColor2
),
...
...
@@ -542,13 +540,11 @@ void main() {
testWidgets
(
'MaterialButton has no clip by default'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
buttonKey
=
GlobalKey
();
final
Widget
buttonWidget
=
Material
(
child:
Center
(
final
Widget
buttonWidget
=
Center
(
child:
MaterialButton
(
key:
buttonKey
,
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
);
await
tester
.
pumpWidget
(
...
...
@@ -583,14 +579,12 @@ void main() {
// enabled button
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
MaterialButton
(
child:
const
Text
(
'Button'
),
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
),
));
expect
(
semantics
,
hasSemantics
(
...
...
@@ -618,14 +612,12 @@ void main() {
// disabled button
await
tester
.
pumpWidget
(
const
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
MaterialButton
(
onPressed:
null
,
// button is disabled
child:
Text
(
'Button'
),
),
),
),
));
expect
(
semantics
,
hasSemantics
(
...
...
@@ -724,7 +716,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
padded
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
MaterialButton
(
key:
key1
,
...
...
@@ -734,7 +725,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key1
)),
const
Size
(
88.0
,
48.0
));
...
...
@@ -745,7 +735,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
MaterialButton
(
key:
key2
,
...
...
@@ -755,7 +744,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key2
)),
const
Size
(
88.0
,
36.0
));
...
...
packages/flutter/test/material/outline_button_test.dart
View file @
26d4e927
...
...
@@ -845,7 +845,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlineButton
(
key:
buttonKey
,
...
...
@@ -854,7 +853,6 @@ void main() {
),
),
),
),
);
expect
(
...
...
@@ -868,7 +866,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlineButton
(
onPressed:
()
{},
...
...
@@ -876,7 +873,6 @@ void main() {
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
...
...
@@ -908,7 +904,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(),
child:
Center
(
...
...
@@ -919,7 +914,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
OutlineButton
)),
equals
(
const
Size
(
88.0
,
48.0
)));
...
...
@@ -929,7 +923,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
1.3
),
child:
Center
(
...
...
@@ -940,7 +933,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
FlatButton
)),
equals
(
const
Size
(
88.0
,
48.0
)));
...
...
@@ -953,7 +945,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
3.0
),
child:
Center
(
...
...
@@ -964,7 +955,6 @@ void main() {
),
),
),
),
);
// Scaled text rendering is different on Linux and Mac by one pixel.
...
...
@@ -1043,7 +1033,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlineButton
(
materialTapTargetSize:
MaterialTapTargetSize
.
padded
,
...
...
@@ -1052,7 +1041,6 @@ void main() {
),
),
),
),
);
// Default Width of OutlineButton with MaterialTapTargetSize (88)
...
...
@@ -1061,7 +1049,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlineButton
(
materialTapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
,
...
...
@@ -1070,7 +1057,6 @@ void main() {
),
),
),
),
);
// Default Width of OutlineButton with MaterialTapTargetSize (88)
...
...
@@ -1080,7 +1066,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlineButton
.
icon
(
key:
key1
,
...
...
@@ -1091,7 +1076,6 @@ void main() {
),
),
),
),
);
final
Size
addAlarmIconSize
=
tester
.
getSize
(
find
.
byIcon
(
Icons
.
add_alarm
));
...
...
@@ -1107,7 +1091,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlineButton
.
icon
(
key:
key2
,
...
...
@@ -1118,7 +1101,6 @@ void main() {
),
),
),
),
);
// The expected width is the sum of:
...
...
packages/flutter/test/material/outlined_button_test.dart
View file @
26d4e927
...
...
@@ -617,8 +617,7 @@ void main() {
final
GlobalKey
childKey
=
GlobalKey
();
bool
hovering
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SizedBox
(
width:
100
,
...
...
@@ -633,7 +632,6 @@ void main() {
),
),
),
),
);
await
tester
.
pumpAndSettle
();
expect
(
focusNode
.
hasPrimaryFocus
,
isTrue
);
...
...
@@ -645,8 +643,7 @@ void main() {
expect
(
hovering
,
isTrue
);
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SizedBox
(
width:
100
,
...
...
@@ -659,7 +656,6 @@ void main() {
),
),
),
),
);
await
tester
.
pumpAndSettle
();
...
...
@@ -671,8 +667,7 @@ void main() {
late
bool
hover
;
Widget
buildFrame
({
required
bool
enabled
})
{
return
Material
(
child:
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
SizedBox
(
...
...
@@ -688,7 +683,6 @@ void main() {
),
),
),
),
);
}
...
...
@@ -735,8 +729,7 @@ void main() {
final
FocusNode
node
=
FocusNode
(
debugLabel:
'OutlinedButton Focus'
);
bool
gotFocus
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
OutlinedButton
(
focusNode:
node
,
...
...
@@ -745,7 +738,6 @@ void main() {
child:
const
SizedBox
(),
),
),
),
);
node
.
requestFocus
();
...
...
@@ -766,8 +758,7 @@ void main() {
final
FocusNode
node
=
FocusNode
(
debugLabel:
'OutlinedButton Focus'
);
bool
gotFocus
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
OutlinedButton
(
focusNode:
node
,
...
...
@@ -776,7 +767,6 @@ void main() {
child:
const
SizedBox
(),
),
),
),
);
node
.
requestFocus
();
...
...
@@ -909,7 +899,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlinedButton
(
key:
buttonKey
,
...
...
@@ -918,7 +907,6 @@ void main() {
),
),
),
),
);
expect
(
...
...
@@ -933,7 +921,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
OutlinedButton
(
style:
ButtonStyle
(
...
...
@@ -947,7 +934,6 @@ void main() {
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
...
...
@@ -979,7 +965,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(),
child:
Center
(
...
...
@@ -996,7 +981,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
OutlinedButton
)),
equals
(
const
Size
(
88.0
,
48.0
)));
...
...
@@ -1006,7 +990,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
1.3
),
child:
Center
(
...
...
@@ -1023,7 +1006,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
OutlinedButton
)),
equals
(
const
Size
(
88.0
,
48.0
)));
...
...
@@ -1036,7 +1018,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
3.0
),
child:
Center
(
...
...
@@ -1047,7 +1028,6 @@ void main() {
),
),
),
),
);
// Scaled text rendering is different on Linux and Mac by one pixel.
...
...
packages/flutter/test/material/raised_button_test.dart
View file @
26d4e927
...
...
@@ -529,7 +529,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
RaisedButton
(
onPressed:
()
{
},
...
...
@@ -537,7 +536,6 @@ void main() {
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
...
...
@@ -572,7 +570,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
padded
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
RaisedButton
(
key:
key1
,
...
...
@@ -582,7 +579,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key1
)),
const
Size
(
88.0
,
48.0
));
...
...
@@ -593,7 +589,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
RaisedButton
(
key:
key2
,
...
...
@@ -603,7 +598,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byKey
(
key2
)),
const
Size
(
88.0
,
36.0
));
...
...
@@ -613,12 +607,10 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
RaisedButton
(
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
),
);
expect
(
...
...
@@ -696,7 +688,6 @@ void main() {
// horizontal padding is applied correctly later on
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
RaisedButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
),
...
...
@@ -710,7 +701,6 @@ void main() {
),
),
),
),
);
final
Rect
paddingRect
=
tester
.
getRect
(
find
.
byType
(
Padding
));
...
...
packages/flutter/test/material/text_button_test.dart
View file @
26d4e927
...
...
@@ -395,13 +395,11 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
TextButton
(
child:
Container
(),
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
),
);
expect
(
...
...
@@ -420,7 +418,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
TextButton
(
style:
ButtonStyle
(
overlayColor:
MaterialStateProperty
.
resolveWith
<
Color
?>(
getOverlayColor
),
...
...
@@ -429,7 +426,6 @@ void main() {
onPressed:
()
{
/* to make sure the button is enabled */
},
),
),
),
);
...
...
@@ -478,7 +474,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
TextButton
(
style:
ButtonStyle
(
...
...
@@ -492,7 +487,6 @@ void main() {
),
),
),
),
);
expect
(
semantics
,
hasSemantics
(
...
...
@@ -524,7 +518,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(),
child:
Center
(
...
...
@@ -535,7 +528,6 @@ void main() {
),
),
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
TextButton
)),
equals
(
const
Size
(
64.0
,
48.0
)));
...
...
@@ -545,7 +537,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
1.3
),
child:
Center
(
...
...
@@ -556,7 +547,6 @@ void main() {
),
),
),
),
);
// Scaled text rendering is different on Linux and Mac by one pixel.
...
...
@@ -570,7 +560,6 @@ void main() {
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
MediaQuery
(
data:
const
MediaQueryData
(
textScaleFactor:
3.0
),
child:
Center
(
...
...
@@ -581,7 +570,6 @@ void main() {
),
),
),
),
);
// Scaled text rendering is different on Linux and Mac by one pixel.
...
...
@@ -599,7 +587,6 @@ void main() {
data:
ThemeData
(
materialTapTargetSize:
tapTargetSize
),
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Center
(
child:
TextButton
(
key:
key
,
...
...
@@ -608,7 +595,6 @@ void main() {
),
),
),
),
);
}
...
...
@@ -701,8 +687,7 @@ void main() {
final
GlobalKey
childKey
=
GlobalKey
();
bool
hovering
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SizedBox
(
width:
100
,
...
...
@@ -717,7 +702,6 @@ void main() {
),
),
),
),
);
await
tester
.
pumpAndSettle
();
expect
(
focusNode
.
hasPrimaryFocus
,
isTrue
);
...
...
@@ -729,8 +713,7 @@ void main() {
expect
(
hovering
,
isTrue
);
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
SizedBox
(
width:
100
,
...
...
@@ -743,7 +726,6 @@ void main() {
),
),
),
),
);
await
tester
.
pumpAndSettle
();
...
...
@@ -755,8 +737,7 @@ void main() {
late
bool
hover
;
Widget
buildFrame
({
required
bool
enabled
})
{
return
Material
(
child:
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
SizedBox
(
...
...
@@ -772,7 +753,6 @@ void main() {
),
),
),
),
);
}
...
...
@@ -819,8 +799,7 @@ void main() {
final
FocusNode
node
=
FocusNode
(
debugLabel:
'TextButton Focus'
);
bool
gotFocus
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
TextButton
(
focusNode:
node
,
...
...
@@ -829,7 +808,6 @@ void main() {
child:
const
SizedBox
(),
),
),
),
);
node
.
requestFocus
();
...
...
@@ -850,8 +828,7 @@ void main() {
final
FocusNode
node
=
FocusNode
(
debugLabel:
'TextButton Focus'
);
bool
gotFocus
=
false
;
await
tester
.
pumpWidget
(
Material
(
child:
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
TextButton
(
focusNode:
node
,
...
...
@@ -860,7 +837,6 @@ void main() {
child:
const
SizedBox
(),
),
),
),
);
node
.
requestFocus
();
...
...
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