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
192b0640
Unverified
Commit
192b0640
authored
Jun 09, 2023
by
Taha Tesser
Committed by
GitHub
Jun 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `MaterialButton` from test classes (#128466)
fixes
https://github.com/flutter/flutter/issues/128465
parent
8600eb12
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
28 deletions
+32
-28
bottom_sheet_test.dart
packages/flutter/test/material/bottom_sheet_test.dart
+4
-4
card_test.dart
packages/flutter/test/material/card_test.dart
+2
-2
search_test.dart
packages/flutter/test/material/search_test.dart
+2
-2
toggle_buttons_test.dart
packages/flutter/test/material/toggle_buttons_test.dart
+8
-4
actions_test.dart
packages/flutter/test/widgets/actions_test.dart
+12
-12
focus_traversal_test.dart
packages/flutter/test/widgets/focus_traversal_test.dart
+4
-4
No files found.
packages/flutter/test/material/bottom_sheet_test.dart
View file @
192b0640
...
...
@@ -1402,9 +1402,9 @@ void main() {
reverseDuration:
const
Duration
(
seconds:
2
),
),
builder:
(
BuildContext
context
)
{
return
MaterialButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
),
return
ElevatedButton
(
key:
tapTargetToClose
,
onPressed:
()
=>
Navigator
.
pop
(
context
),
child:
const
Text
(
'BottomSheet'
),
);
},
...
...
@@ -1551,9 +1551,9 @@ void main() {
context:
context
,
transitionAnimationController:
controller
,
builder:
(
BuildContext
context
)
{
return
MaterialButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
),
return
ElevatedButton
(
key:
tapTargetToClose
,
onPressed:
()
=>
Navigator
.
pop
(
context
),
child:
const
Text
(
'BottomSheet'
),
);
},
...
...
packages/flutter/test/material/card_test.dart
View file @
192b0640
...
...
@@ -22,9 +22,9 @@ void main() {
children:
<
Widget
>[
const
Text
(
'I am text!'
),
const
Text
(
'Moar text!!1'
),
MaterialButton
(
child:
const
Text
(
'Button'
),
ElevatedButton
(
onPressed:
()
{
},
child:
const
Text
(
'Button'
),
),
],
),
...
...
packages/flutter/test/material/search_test.dart
View file @
192b0640
...
...
@@ -1029,7 +1029,7 @@ class _TestSearchDelegate extends SearchDelegate<String> {
@override
Widget
buildSuggestions
(
BuildContext
context
)
{
queriesForSuggestions
.
add
(
query
);
return
Material
Button
(
return
Elevated
Button
(
onPressed:
()
{
showResults
(
context
);
},
...
...
@@ -1066,7 +1066,7 @@ class _TestEmptySearchDelegate extends SearchDelegate<String> {
@override
Widget
buildSuggestions
(
BuildContext
context
)
{
return
Material
Button
(
return
Elevated
Button
(
onPressed:
()
{
showResults
(
context
);
},
...
...
packages/flutter/test/material/toggle_buttons_test.dart
View file @
192b0640
...
...
@@ -1345,9 +1345,13 @@ void main() {
Text
(
'Second child'
,
style:
TextStyle
(
fontFamily:
'FlutterTest'
,
fontSize:
8.0
)),
],
),
const
Material
Button
(
Elevated
Button
(
onPressed:
null
,
child:
Text
(
'Material Button'
,
style:
TextStyle
(
fontFamily:
'FlutterTest'
,
fontSize:
20.0
)),
style:
ElevatedButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontFamily:
'FlutterTest'
,
fontSize:
20.0
,
)),
child:
const
Text
(
'Elevated Button'
),
),
const
Text
(
'Text'
,
style:
TextStyle
(
fontFamily:
'FlutterTest'
,
fontSize:
28.0
)),
],
...
...
@@ -1366,11 +1370,11 @@ void main() {
final
double
firstToggleButtonDy
=
tester
.
getBottomLeft
(
find
.
text
(
'First child'
)).
dy
;
final
double
secondToggleButtonDy
=
tester
.
getBottomLeft
(
find
.
text
(
'Second child'
)).
dy
;
final
double
materialButtonDy
=
tester
.
getBottomLeft
(
find
.
text
(
'Material
Button'
)).
dy
;
final
double
elevatedButtonDy
=
tester
.
getBottomLeft
(
find
.
text
(
'Elevated
Button'
)).
dy
;
final
double
textDy
=
tester
.
getBottomLeft
(
find
.
text
(
'Text'
)).
dy
;
expect
(
firstToggleButtonDy
,
secondToggleButtonDy
);
expect
(
firstToggleButtonDy
,
material
ButtonDy
-
3.0
);
expect
(
firstToggleButtonDy
,
elevated
ButtonDy
-
3.0
);
expect
(
firstToggleButtonDy
,
textDy
-
5.0
);
});
...
...
packages/flutter/test/widgets/actions_test.dart
View file @
192b0640
...
...
@@ -863,10 +863,10 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
home:
FocusableActionDetector
(
child:
MaterialButton
(
child:
ElevatedButton
(
onPressed:
()
{},
focusNode:
buttonNode
,
child:
const
Text
(
'Test'
),
onPressed:
()
{},
),
),
),
...
...
@@ -882,10 +882,10 @@ void main() {
MaterialApp
(
home:
FocusableActionDetector
(
descendantsAreFocusable:
false
,
child:
MaterialButton
(
child:
ElevatedButton
(
onPressed:
()
{},
focusNode:
buttonNode
,
child:
const
Text
(
'Test'
),
onPressed:
()
{},
),
),
),
...
...
@@ -910,15 +910,15 @@ void main() {
home:
FocusableActionDetector
(
child:
Column
(
children:
<
Widget
>[
MaterialButton
(
ElevatedButton
(
onPressed:
()
{},
focusNode:
buttonNode1
,
child:
const
Text
(
'Node 1'
),
onPressed:
()
{},
),
MaterialButton
(
ElevatedButton
(
onPressed:
()
{},
focusNode:
buttonNode2
,
child:
const
Text
(
'Node 2'
),
onPressed:
()
{},
),
],
),
...
...
@@ -941,15 +941,15 @@ void main() {
descendantsAreTraversable:
false
,
child:
Column
(
children:
<
Widget
>[
MaterialButton
(
ElevatedButton
(
onPressed:
()
{},
focusNode:
buttonNode1
,
child:
const
Text
(
'Node 1'
),
onPressed:
()
{},
),
MaterialButton
(
ElevatedButton
(
onPressed:
()
{},
focusNode:
buttonNode2
,
child:
const
Text
(
'Node 2'
),
onPressed:
()
{},
),
],
),
...
...
packages/flutter/test/widgets/focus_traversal_test.dart
View file @
192b0640
...
...
@@ -331,7 +331,7 @@ void main() {
policy:
WidgetOrderTraversalPolicy
(),
child:
Center
(
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
Material
Button
(
return
Elevated
Button
(
key:
key1
,
focusNode:
testNode1
,
autofocus:
true
,
...
...
@@ -340,7 +340,7 @@ void main() {
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
return
Center
(
child:
Material
Button
(
child:
Elevated
Button
(
key:
key2
,
focusNode:
testNode2
,
autofocus:
true
,
...
...
@@ -1218,7 +1218,7 @@ void main() {
child:
Builder
(
builder:
(
BuildContext
context
)
{
return
FocusTraversalOrder
(
order:
const
NumericFocusOrder
(
0
),
child:
Material
Button
(
child:
Elevated
Button
(
key:
key1
,
focusNode:
testNode1
,
autofocus:
true
,
...
...
@@ -1229,7 +1229,7 @@ void main() {
return
Center
(
child:
FocusTraversalOrder
(
order:
const
NumericFocusOrder
(
0
),
child:
Material
Button
(
child:
Elevated
Button
(
key:
key2
,
focusNode:
testNode2
,
autofocus:
true
,
...
...
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