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
2856d663
Unverified
Commit
2856d663
authored
Jul 28, 2020
by
Darren Austin
Committed by
GitHub
Jul 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the framework tests to use the new button API. (#62220)
parent
0beda0e7
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
95 additions
and
95 deletions
+95
-95
system_fonts_test.dart
packages/flutter/test/painting/system_fonts_test.dart
+1
-1
draggable_scrollable_sheet_test.dart
...flutter/test/widgets/draggable_scrollable_sheet_test.dart
+1
-1
drawer_test.dart
packages/flutter/test/widgets/drawer_test.dart
+2
-2
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+1
-1
heroes_test.dart
packages/flutter/test/widgets/heroes_test.dart
+24
-24
inherited_model_test.dart
packages/flutter/test/widgets/inherited_model_test.dart
+10
-10
navigator_test.dart
packages/flutter/test/widgets/navigator_test.dart
+8
-8
range_maintaining_scroll_physics_test.dart
...r/test/widgets/range_maintaining_scroll_physics_test.dart
+4
-4
routes_test.dart
packages/flutter/test/widgets/routes_test.dart
+19
-19
run_app_test.dart
packages/flutter/test/widgets/run_app_test.dart
+1
-1
semantics_debugger_test.dart
packages/flutter/test/widgets/semantics_debugger_test.dart
+4
-4
sliver_fill_remaining_test.dart
...ages/flutter/test/widgets/sliver_fill_remaining_test.dart
+16
-16
widget_inspector_test.dart
packages/flutter/test/widgets/widget_inspector_test.dart
+4
-4
No files found.
packages/flutter/test/painting/system_fonts_test.dart
View file @
2856d663
...
@@ -208,7 +208,7 @@ void main() {
...
@@ -208,7 +208,7 @@ void main() {
child:
Center
(
child:
Center
(
child:
Builder
(
child:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
child:
const
Text
(
'X'
),
child:
const
Text
(
'X'
),
onPressed:
()
{
onPressed:
()
{
showTimePicker
(
showTimePicker
(
...
...
packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart
View file @
2856d663
...
@@ -23,7 +23,7 @@ void main() {
...
@@ -23,7 +23,7 @@ void main() {
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
Stack
(
child:
Stack
(
children:
<
Widget
>[
children:
<
Widget
>[
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'TapHere'
),
child:
const
Text
(
'TapHere'
),
onPressed:
onButtonPressed
,
onPressed:
onButtonPressed
,
),
),
...
...
packages/flutter/test/widgets/drawer_test.dart
View file @
2856d663
...
@@ -270,7 +270,7 @@ void main() {
...
@@ -270,7 +270,7 @@ void main() {
child:
ListView
(
child:
ListView
(
children:
<
Widget
>[
children:
<
Widget
>[
const
Text
(
'drawer'
),
const
Text
(
'drawer'
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'close'
),
child:
const
Text
(
'close'
),
onPressed:
()
=>
Navigator
.
pop
(
context
),
onPressed:
()
=>
Navigator
.
pop
(
context
),
),
),
...
@@ -278,7 +278,7 @@ void main() {
...
@@ -278,7 +278,7 @@ void main() {
),
),
),
),
body:
Container
(
body:
Container
(
child:
Fla
tButton
(
child:
Tex
tButton
(
child:
const
Text
(
'button'
),
child:
const
Text
(
'button'
),
onPressed:
()
{
buttonPressed
=
true
;
},
onPressed:
()
{
buttonPressed
=
true
;
},
),
),
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
2856d663
...
@@ -5344,7 +5344,7 @@ class _TransformedEditableTextState extends State<TransformedEditableText> {
...
@@ -5344,7 +5344,7 @@ class _TransformedEditableTextState extends State<TransformedEditableText> {
backgroundCursorColor:
Colors
.
grey
,
backgroundCursorColor:
Colors
.
grey
,
),
),
),
),
Rais
edButton
(
Elevat
edButton
(
key:
widget
.
transformButtonKey
,
key:
widget
.
transformButtonKey
,
onPressed:
()
{
onPressed:
()
{
setState
(()
{
setState
(()
{
...
...
packages/flutter/test/widgets/heroes_test.dart
View file @
2856d663
...
@@ -49,15 +49,15 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
...
@@ -49,15 +49,15 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child:
Container
(
height:
100.0
,
width:
100.0
,
key:
firstKey
),
child:
Container
(
height:
100.0
,
width:
100.0
,
key:
firstKey
),
)),
)),
const
SizedBox
(
height:
100.0
,
width:
100.0
),
const
SizedBox
(
height:
100.0
,
width:
100.0
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'two'
),
child:
const
Text
(
'two'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/two'
);
},
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/two'
);
},
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'twoInset'
),
child:
const
Text
(
'twoInset'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/twoInset'
);
},
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/twoInset'
);
},
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'simple'
),
child:
const
Text
(
'simple'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/simple'
);
},
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/simple'
);
},
),
),
...
@@ -68,7 +68,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
...
@@ -68,7 +68,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child:
ListView
(
child:
ListView
(
key:
routeTwoKey
,
key:
routeTwoKey
,
children:
<
Widget
>[
children:
<
Widget
>[
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'pop'
),
child:
const
Text
(
'pop'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -79,7 +79,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
...
@@ -79,7 +79,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child:
Container
(
height:
150.0
,
width:
150.0
,
key:
secondKey
),
child:
Container
(
height:
150.0
,
width:
150.0
,
key:
secondKey
),
)),
)),
const
SizedBox
(
height:
150.0
,
width:
150.0
),
const
SizedBox
(
height:
150.0
,
width:
150.0
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'three'
),
child:
const
Text
(
'three'
),
onPressed:
()
{
Navigator
.
push
(
context
,
ThreeRoute
());
},
onPressed:
()
{
Navigator
.
push
(
context
,
ThreeRoute
());
},
),
),
...
@@ -94,7 +94,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
...
@@ -94,7 +94,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
child:
ListView
(
child:
ListView
(
key:
routeTwoKey
,
key:
routeTwoKey
,
children:
<
Widget
>[
children:
<
Widget
>[
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'pop'
),
child:
const
Text
(
'pop'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -110,7 +110,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
...
@@ -110,7 +110,7 @@ final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
),
),
),
),
const
SizedBox
(
height:
150.0
,
width:
150.0
),
const
SizedBox
(
height:
150.0
,
width:
150.0
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'three'
),
child:
const
Text
(
'three'
),
onPressed:
()
{
Navigator
.
push
(
context
,
ThreeRoute
());
},
onPressed:
()
{
Navigator
.
push
(
context
,
ThreeRoute
());
},
),
),
...
@@ -433,7 +433,7 @@ Future<void> main() async {
...
@@ -433,7 +433,7 @@ Future<void> main() async {
children:
<
Widget
>[
children:
<
Widget
>[
const
Hero
(
tag:
'a'
,
child:
Text
(
'foo'
)),
const
Hero
(
tag:
'a'
,
child:
Text
(
'foo'
)),
Builder
(
builder:
(
BuildContext
context
)
{
Builder
(
builder:
(
BuildContext
context
)
{
return
Fla
tButton
(
child:
const
Text
(
'two'
),
onPressed:
()
=>
Navigator
.
push
(
context
,
route
));
return
Tex
tButton
(
child:
const
Text
(
'two'
),
onPressed:
()
=>
Navigator
.
push
(
context
,
route
));
}),
}),
],
],
),
),
...
@@ -618,7 +618,7 @@ Future<void> main() async {
...
@@ -618,7 +618,7 @@ Future<void> main() async {
const
Hero
(
tag:
'a'
,
child:
Text
(
'a too'
)),
const
Hero
(
tag:
'a'
,
child:
Text
(
'a too'
)),
Builder
(
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'push'
),
child:
const
Text
(
'push'
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
push
(
context
,
PageRouteBuilder
<
void
>(
Navigator
.
push
(
context
,
PageRouteBuilder
<
void
>(
...
@@ -821,7 +821,7 @@ Future<void> main() async {
...
@@ -821,7 +821,7 @@ Future<void> main() async {
);
);
},
},
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'POP'
),
child:
const
Text
(
'POP'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -842,7 +842,7 @@ Future<void> main() async {
...
@@ -842,7 +842,7 @@ Future<void> main() async {
Card
(
Card
(
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
homeHeroKey
,
height:
100.0
,
width:
100.0
)),
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
homeHeroKey
,
height:
100.0
,
width:
100.0
)),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'PUSH'
),
child:
const
Text
(
'PUSH'
),
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
),
),
...
@@ -919,7 +919,7 @@ Future<void> main() async {
...
@@ -919,7 +919,7 @@ Future<void> main() async {
key:
routeContainerKey
,
key:
routeContainerKey
,
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
routeHeroKey
,
height:
200.0
,
width:
200.0
)),
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
routeHeroKey
,
height:
200.0
,
width:
200.0
)),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'POP'
),
child:
const
Text
(
'POP'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -950,7 +950,7 @@ Future<void> main() async {
...
@@ -950,7 +950,7 @@ Future<void> main() async {
Container
(
Container
(
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
homeHeroKey
,
height:
100.0
,
width:
100.0
)),
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
homeHeroKey
,
height:
100.0
,
width:
100.0
)),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'PUSH'
),
child:
const
Text
(
'PUSH'
),
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
),
),
...
@@ -1029,7 +1029,7 @@ Future<void> main() async {
...
@@ -1029,7 +1029,7 @@ Future<void> main() async {
Container
(
Container
(
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
homeHeroKey
,
height:
100.0
,
width:
100.0
)),
child:
Hero
(
tag:
'H'
,
child:
Container
(
key:
homeHeroKey
,
height:
100.0
,
width:
100.0
)),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'PUSH'
),
child:
const
Text
(
'PUSH'
),
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
),
),
...
@@ -1117,7 +1117,7 @@ Future<void> main() async {
...
@@ -1117,7 +1117,7 @@ Future<void> main() async {
),
),
),
),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'PUSH C'
),
child:
const
Text
(
'PUSH C'
),
onPressed:
()
{
Navigator
.
push
(
context
,
routeC
);
},
onPressed:
()
{
Navigator
.
push
(
context
,
routeC
);
},
),
),
...
@@ -1157,7 +1157,7 @@ Future<void> main() async {
...
@@ -1157,7 +1157,7 @@ Future<void> main() async {
),
),
),
),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'PUSH B'
),
child:
const
Text
(
'PUSH B'
),
onPressed:
()
{
Navigator
.
push
(
context
,
routeB
);
},
onPressed:
()
{
Navigator
.
push
(
context
,
routeB
);
},
),
),
...
@@ -1230,7 +1230,7 @@ Future<void> main() async {
...
@@ -1230,7 +1230,7 @@ Future<void> main() async {
),
),
),
),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'POP'
),
child:
const
Text
(
'POP'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -1256,7 +1256,7 @@ Future<void> main() async {
...
@@ -1256,7 +1256,7 @@ Future<void> main() async {
),
),
),
),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'PUSH'
),
child:
const
Text
(
'PUSH'
),
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
onPressed:
()
{
Navigator
.
push
(
context
,
route
);
},
),
),
...
@@ -1314,7 +1314,7 @@ Future<void> main() async {
...
@@ -1314,7 +1314,7 @@ Future<void> main() async {
createRectTween:
createRectTween
,
createRectTween:
createRectTween
,
child:
Container
(
height:
100.0
,
width:
100.0
,
key:
firstKey
),
child:
Container
(
height:
100.0
,
width:
100.0
,
key:
firstKey
),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'two'
),
child:
const
Text
(
'two'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/two'
);
},
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/two'
);
},
),
),
...
@@ -1327,7 +1327,7 @@ Future<void> main() async {
...
@@ -1327,7 +1327,7 @@ Future<void> main() async {
children:
<
Widget
>[
children:
<
Widget
>[
SizedBox
(
SizedBox
(
height:
200.0
,
height:
200.0
,
child:
Fla
tButton
(
child:
Tex
tButton
(
child:
const
Text
(
'pop'
),
child:
const
Text
(
'pop'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -1429,7 +1429,7 @@ Future<void> main() async {
...
@@ -1429,7 +1429,7 @@ Future<void> main() async {
createRectTween:
createRectTween
,
createRectTween:
createRectTween
,
child:
Container
(
height:
100.0
,
width:
100.0
,
key:
firstKey
),
child:
Container
(
height:
100.0
,
width:
100.0
,
key:
firstKey
),
),
),
Fla
tButton
(
Tex
tButton
(
child:
const
Text
(
'two'
),
child:
const
Text
(
'two'
),
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/two'
);
},
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/two'
);
},
),
),
...
@@ -1442,7 +1442,7 @@ Future<void> main() async {
...
@@ -1442,7 +1442,7 @@ Future<void> main() async {
children:
<
Widget
>[
children:
<
Widget
>[
SizedBox
(
SizedBox
(
height:
200.0
,
height:
200.0
,
child:
Fla
tButton
(
child:
Tex
tButton
(
child:
const
Text
(
'pop'
),
child:
const
Text
(
'pop'
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
),
...
@@ -1634,7 +1634,7 @@ Future<void> main() async {
...
@@ -1634,7 +1634,7 @@ Future<void> main() async {
children:
<
Widget
>[
children:
<
Widget
>[
const
Hero
(
tag:
'a'
,
child:
Text
(
'foo'
)),
const
Hero
(
tag:
'a'
,
child:
Text
(
'foo'
)),
Builder
(
builder:
(
BuildContext
context
)
{
Builder
(
builder:
(
BuildContext
context
)
{
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'two'
),
child:
const
Text
(
'two'
),
onPressed:
()
=>
Navigator
.
push
<
void
>(
context
,
MaterialPageRoute
<
void
>(
onPressed:
()
=>
Navigator
.
push
<
void
>(
context
,
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
...
@@ -1684,7 +1684,7 @@ Future<void> main() async {
...
@@ -1684,7 +1684,7 @@ Future<void> main() async {
},
},
),
),
Builder
(
builder:
(
BuildContext
context
)
{
Builder
(
builder:
(
BuildContext
context
)
{
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'two'
),
child:
const
Text
(
'two'
),
onPressed:
()
=>
Navigator
.
push
<
void
>(
context
,
MaterialPageRoute
<
void
>(
onPressed:
()
=>
Navigator
.
push
<
void
>(
context
,
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
...
...
packages/flutter/test/widgets/inherited_model_test.dart
View file @
2856d663
...
@@ -111,7 +111,7 @@ void main() {
...
@@ -111,7 +111,7 @@ void main() {
showB
,
showB
,
showC
,
showC
,
showABC
,
showABC
,
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment a'
),
child:
const
Text
(
'Increment a'
),
onPressed:
()
{
onPressed:
()
{
// Rebuilds the ABCModel which triggers a rebuild
// Rebuilds the ABCModel which triggers a rebuild
...
@@ -120,7 +120,7 @@ void main() {
...
@@ -120,7 +120,7 @@ void main() {
setState
(()
{
_a
+=
1
;
});
setState
(()
{
_a
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment b'
),
child:
const
Text
(
'Increment b'
),
onPressed:
()
{
onPressed:
()
{
// Rebuilds the ABCModel which triggers a rebuild
// Rebuilds the ABCModel which triggers a rebuild
...
@@ -129,7 +129,7 @@ void main() {
...
@@ -129,7 +129,7 @@ void main() {
setState
(()
{
_b
+=
1
;
});
setState
(()
{
_b
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment c'
),
child:
const
Text
(
'Increment c'
),
onPressed:
()
{
onPressed:
()
{
// Rebuilds the ABCModel which triggers a rebuild
// Rebuilds the ABCModel which triggers a rebuild
...
@@ -254,19 +254,19 @@ void main() {
...
@@ -254,19 +254,19 @@ void main() {
const
SizedBox
(
height:
24.0
),
const
SizedBox
(
height:
24.0
),
showABC
,
showABC
,
const
SizedBox
(
height:
24.0
),
const
SizedBox
(
height:
24.0
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment a'
),
child:
const
Text
(
'Increment a'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
_a
+=
1
;
});
setState
(()
{
_a
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment b'
),
child:
const
Text
(
'Increment b'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
_b
+=
1
;
});
setState
(()
{
_b
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment c'
),
child:
const
Text
(
'Increment c'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
_c
+=
1
;
});
setState
(()
{
_c
+=
1
;
});
...
@@ -371,25 +371,25 @@ void main() {
...
@@ -371,25 +371,25 @@ void main() {
const
SizedBox
(
height:
24.0
),
const
SizedBox
(
height:
24.0
),
showABC
,
showABC
,
const
SizedBox
(
height:
24.0
),
const
SizedBox
(
height:
24.0
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment a'
),
child:
const
Text
(
'Increment a'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
_a
+=
1
;
});
setState
(()
{
_a
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment b'
),
child:
const
Text
(
'Increment b'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
_b
+=
1
;
});
setState
(()
{
_b
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Increment c'
),
child:
const
Text
(
'Increment c'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
_c
+=
1
;
});
setState
(()
{
_c
+=
1
;
});
},
},
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'rebuild'
),
child:
const
Text
(
'rebuild'
),
onPressed:
()
{
onPressed:
()
{
setState
(()
{
setState
(()
{
...
...
packages/flutter/test/widgets/navigator_test.dart
View file @
2856d663
...
@@ -203,13 +203,13 @@ void main() {
...
@@ -203,13 +203,13 @@ void main() {
if
(
settings
.
name
==
'/'
)
{
if
(
settings
.
name
==
'/'
)
{
return
MaterialPageRoute
<
void
>(
return
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
child:
const
Text
(
'Next'
),
child:
const
Text
(
'Next'
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
<
void
>(
MaterialPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
child:
const
Text
(
'Inner page'
),
child:
const
Text
(
'Inner page'
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
,
rootNavigator:
true
).
push
(
Navigator
.
of
(
context
,
rootNavigator:
true
).
push
(
...
@@ -1063,19 +1063,19 @@ void main() {
...
@@ -1063,19 +1063,19 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
navigatorKey:
key
,
navigatorKey:
key
,
navigatorObservers:
<
NavigatorObserver
>[
observer
],
navigatorObservers:
<
NavigatorObserver
>[
observer
],
home:
Fla
tButton
(
home:
Tex
tButton
(
child:
const
Text
(
'A'
),
child:
const
Text
(
'A'
),
onPressed:
()
{
onPressed:
()
{
key
.
currentState
.
push
<
void
>(
routeB
=
MaterialPageRoute
<
void
>(
key
.
currentState
.
push
<
void
>(
routeB
=
MaterialPageRoute
<
void
>(
settings:
const
RouteSettings
(
name:
'B'
),
settings:
const
RouteSettings
(
name:
'B'
),
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'B'
),
child:
const
Text
(
'B'
),
onPressed:
()
{
onPressed:
()
{
key
.
currentState
.
push
<
void
>(
MaterialPageRoute
<
int
>(
key
.
currentState
.
push
<
void
>(
MaterialPageRoute
<
int
>(
settings:
const
RouteSettings
(
name:
'C'
),
settings:
const
RouteSettings
(
name:
'C'
),
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'C'
),
child:
const
Text
(
'C'
),
onPressed:
()
{
onPressed:
()
{
key
.
currentState
.
replace
(
key
.
currentState
.
replace
(
...
@@ -1157,14 +1157,14 @@ void main() {
...
@@ -1157,14 +1157,14 @@ void main() {
},
},
),
),
),
),
home:
Fla
tButton
(
home:
Tex
tButton
(
child:
const
Text
(
'A'
),
child:
const
Text
(
'A'
),
onPressed:
()
{
onPressed:
()
{
key
.
currentState
.
push
<
void
>(
routeB
=
MaterialPageRoute
<
void
>(
key
.
currentState
.
push
<
void
>(
routeB
=
MaterialPageRoute
<
void
>(
settings:
const
RouteSettings
(
name:
'B'
),
settings:
const
RouteSettings
(
name:
'B'
),
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
log
.
add
(
'building B'
);
log
.
add
(
'building B'
);
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'B'
),
child:
const
Text
(
'B'
),
onPressed:
()
{
onPressed:
()
{
key
.
currentState
.
push
<
void
>(
MaterialPageRoute
<
int
>(
key
.
currentState
.
push
<
void
>(
MaterialPageRoute
<
int
>(
...
@@ -1172,7 +1172,7 @@ void main() {
...
@@ -1172,7 +1172,7 @@ void main() {
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
log
.
add
(
'building C'
);
log
.
add
(
'building C'
);
log
.
add
(
'found
${ModalRoute.of(context).settings.name}
'
);
log
.
add
(
'found
${ModalRoute.of(context).settings.name}
'
);
return
Fla
tButton
(
return
Tex
tButton
(
child:
const
Text
(
'C'
),
child:
const
Text
(
'C'
),
onPressed:
()
{
onPressed:
()
{
key
.
currentState
.
replace
(
key
.
currentState
.
replace
(
...
...
packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart
View file @
2856d663
...
@@ -40,7 +40,7 @@ class _ExpandingBoxState extends State<ExpandingBox> with AutomaticKeepAliveClie
...
@@ -40,7 +40,7 @@ class _ExpandingBoxState extends State<ExpandingBox> with AutomaticKeepAliveClie
color:
Colors
.
green
,
color:
Colors
.
green
,
child:
Align
(
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
Fla
tButton
(
child:
Tex
tButton
(
child:
const
Text
(
'Collapse'
),
child:
const
Text
(
'Collapse'
),
onPressed:
toggleSize
,
onPressed:
toggleSize
,
),
),
...
@@ -68,7 +68,7 @@ void main() {
...
@@ -68,7 +68,7 @@ void main() {
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
maxScrollExtent
,
100.0
);
expect
(
position
.
maxScrollExtent
,
100.0
);
expect
(
position
.
pixels
,
0.0
);
expect
(
position
.
pixels
,
0.0
);
await
tester
.
tap
(
find
.
byType
(
Fla
tButton
));
await
tester
.
tap
(
find
.
byType
(
Tex
tButton
));
await
tester
.
pump
();
await
tester
.
pump
();
final
TestGesture
drag1
=
await
tester
.
startGesture
(
const
Offset
(
10.0
,
500.0
));
final
TestGesture
drag1
=
await
tester
.
startGesture
(
const
Offset
(
10.0
,
500.0
));
...
@@ -91,7 +91,7 @@ void main() {
...
@@ -91,7 +91,7 @@ void main() {
expect
(
position
.
pixels
,
moreOrLessEquals
(
900.0
));
expect
(
position
.
pixels
,
moreOrLessEquals
(
900.0
));
await
tester
.
pump
();
await
tester
.
pump
();
await
tester
.
tap
(
find
.
byType
(
Fla
tButton
));
await
tester
.
tap
(
find
.
byType
(
Tex
tButton
));
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
maxScrollExtent
,
100.0
);
expect
(
position
.
maxScrollExtent
,
100.0
);
...
@@ -113,7 +113,7 @@ void main() {
...
@@ -113,7 +113,7 @@ void main() {
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
maxScrollExtent
,
100.0
);
expect
(
position
.
maxScrollExtent
,
100.0
);
expect
(
position
.
pixels
,
0.0
);
expect
(
position
.
pixels
,
0.0
);
await
tester
.
tap
(
find
.
byType
(
Fla
tButton
));
await
tester
.
tap
(
find
.
byType
(
Tex
tButton
));
await
tester
.
pump
();
// start button animation
await
tester
.
pump
();
// start button animation
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// finish button animation
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// finish button animation
expect
(
position
.
minScrollExtent
,
0.0
);
expect
(
position
.
minScrollExtent
,
0.0
);
...
...
packages/flutter/test/widgets/routes_test.dart
View file @
2856d663
...
@@ -1073,7 +1073,7 @@ void main() {
...
@@ -1073,7 +1073,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Builder
(
home:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
showGeneralDialog
<
void
>(
showGeneralDialog
<
void
>(
context:
context
,
context:
context
,
...
@@ -1093,7 +1093,7 @@ void main() {
...
@@ -1093,7 +1093,7 @@ void main() {
));
));
// Open the dialog.
// Open the dialog.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
find
.
byType
(
ModalBarrier
),
findsNWidgets
(
2
));
expect
(
find
.
byType
(
ModalBarrier
),
findsNWidgets
(
2
));
...
@@ -1107,7 +1107,7 @@ void main() {
...
@@ -1107,7 +1107,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Builder
(
home:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
showGeneralDialog
<
void
>(
showGeneralDialog
<
void
>(
context:
context
,
context:
context
,
...
@@ -1125,7 +1125,7 @@ void main() {
...
@@ -1125,7 +1125,7 @@ void main() {
));
));
// Open the dialog.
// Open the dialog.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
find
.
byType
(
ModalBarrier
),
findsNWidgets
(
2
));
expect
(
find
.
byType
(
ModalBarrier
),
findsNWidgets
(
2
));
final
ModalBarrier
barrier
=
find
.
byType
(
ModalBarrier
).
evaluate
().
last
.
widget
as
ModalBarrier
;
final
ModalBarrier
barrier
=
find
.
byType
(
ModalBarrier
).
evaluate
().
last
.
widget
as
ModalBarrier
;
...
@@ -1150,7 +1150,7 @@ void main() {
...
@@ -1150,7 +1150,7 @@ void main() {
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
showGeneralDialog
<
void
>(
showGeneralDialog
<
void
>(
context:
context
,
context:
context
,
...
@@ -1170,7 +1170,7 @@ void main() {
...
@@ -1170,7 +1170,7 @@ void main() {
));
));
// Open the dialog.
// Open the dialog.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
expect
(
rootObserver
.
dialogCount
,
1
);
expect
(
rootObserver
.
dialogCount
,
1
);
expect
(
nestedObserver
.
dialogCount
,
0
);
expect
(
nestedObserver
.
dialogCount
,
0
);
...
@@ -1187,7 +1187,7 @@ void main() {
...
@@ -1187,7 +1187,7 @@ void main() {
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
showGeneralDialog
<
void
>(
showGeneralDialog
<
void
>(
useRootNavigator:
false
,
useRootNavigator:
false
,
...
@@ -1208,7 +1208,7 @@ void main() {
...
@@ -1208,7 +1208,7 @@ void main() {
));
));
// Open the dialog.
// Open the dialog.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
expect
(
rootObserver
.
dialogCount
,
0
);
expect
(
rootObserver
.
dialogCount
,
0
);
expect
(
nestedObserver
.
dialogCount
,
1
);
expect
(
nestedObserver
.
dialogCount
,
1
);
...
@@ -1223,7 +1223,7 @@ void main() {
...
@@ -1223,7 +1223,7 @@ void main() {
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
showGeneralDialog
<
void
>(
showGeneralDialog
<
void
>(
context:
context
,
context:
context
,
...
@@ -1241,7 +1241,7 @@ void main() {
...
@@ -1241,7 +1241,7 @@ void main() {
));
));
// Open the dialog.
// Open the dialog.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
expect
(
rootObserver
.
dialogRoutes
.
length
,
equals
(
1
));
expect
(
rootObserver
.
dialogRoutes
.
length
,
equals
(
1
));
final
ModalRoute
<
dynamic
>
route
=
rootObserver
.
dialogRoutes
.
last
;
final
ModalRoute
<
dynamic
>
route
=
rootObserver
.
dialogRoutes
.
last
;
expect
(
route
.
barrierDismissible
,
isNotNull
);
expect
(
route
.
barrierDismissible
,
isNotNull
);
...
@@ -1257,7 +1257,7 @@ void main() {
...
@@ -1257,7 +1257,7 @@ void main() {
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
<
void
>(
Navigator
.
of
(
context
).
push
<
void
>(
MaterialPageRoute
<
void
>(
MaterialPageRoute
<
void
>(
...
@@ -1278,7 +1278,7 @@ void main() {
...
@@ -1278,7 +1278,7 @@ void main() {
));
));
// Open the new route.
// Open the new route.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Open page'
),
findsNothing
);
expect
(
find
.
text
(
'Open page'
),
findsNothing
);
expect
(
find
.
byKey
(
containerKey
),
findsOneWidget
);
expect
(
find
.
byKey
(
containerKey
),
findsOneWidget
);
...
@@ -1307,7 +1307,7 @@ void main() {
...
@@ -1307,7 +1307,7 @@ void main() {
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
<
void
>(
Navigator
.
of
(
context
).
push
<
void
>(
ModifiedReverseTransitionDurationRoute
<
void
>(
ModifiedReverseTransitionDurationRoute
<
void
>(
...
@@ -1330,7 +1330,7 @@ void main() {
...
@@ -1330,7 +1330,7 @@ void main() {
));
));
// Open the new route.
// Open the new route.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Open page'
),
findsNothing
);
expect
(
find
.
text
(
'Open page'
),
findsNothing
);
expect
(
find
.
byKey
(
containerKey
),
findsOneWidget
);
expect
(
find
.
byKey
(
containerKey
),
findsOneWidget
);
...
@@ -1366,7 +1366,7 @@ void main() {
...
@@ -1366,7 +1366,7 @@ void main() {
onGenerateRoute:
(
RouteSettings
settings
)
{
onGenerateRoute:
(
RouteSettings
settings
)
{
return
MaterialPageRoute
<
dynamic
>(
return
MaterialPageRoute
<
dynamic
>(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Rais
edButton
(
return
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
<
void
>(
Navigator
.
of
(
context
).
push
<
void
>(
ModifiedReverseTransitionDurationRoute
<
void
>(
ModifiedReverseTransitionDurationRoute
<
void
>(
...
@@ -1389,7 +1389,7 @@ void main() {
...
@@ -1389,7 +1389,7 @@ void main() {
));
));
// Open the new route.
// Open the new route.
await
tester
.
tap
(
find
.
byType
(
Rais
edButton
));
await
tester
.
tap
(
find
.
byType
(
Elevat
edButton
));
await
tester
.
pump
();
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
// jump partway through the forward transition
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
// jump partway through the forward transition
expect
(
find
.
byKey
(
containerKey
),
findsOneWidget
);
expect
(
find
.
byKey
(
containerKey
),
findsOneWidget
);
...
@@ -1427,7 +1427,7 @@ void main() {
...
@@ -1427,7 +1427,7 @@ void main() {
child:
Builder
(
child:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Center
(
return
Center
(
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'X'
),
child:
const
Text
(
'X'
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
<
void
>(
Navigator
.
of
(
context
).
push
<
void
>(
...
@@ -1489,7 +1489,7 @@ void main() {
...
@@ -1489,7 +1489,7 @@ void main() {
child:
Builder
(
child:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Center
(
return
Center
(
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'X'
),
child:
const
Text
(
'X'
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
<
void
>(
Navigator
.
of
(
context
).
push
<
void
>(
...
@@ -1554,7 +1554,7 @@ void main() {
...
@@ -1554,7 +1554,7 @@ void main() {
child:
Builder
(
child:
Builder
(
builder:
(
BuildContext
context
)
{
builder:
(
BuildContext
context
)
{
return
Center
(
return
Center
(
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'X'
),
child:
const
Text
(
'X'
),
onPressed:
()
{
onPressed:
()
{
Navigator
.
of
(
context
).
push
<
void
>(
Navigator
.
of
(
context
).
push
<
void
>(
...
...
packages/flutter/test/widgets/run_app_test.dart
View file @
2856d663
...
@@ -13,7 +13,7 @@ void main() {
...
@@ -13,7 +13,7 @@ void main() {
Directionality
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
Material
(
child:
Material
(
child:
Rais
edButton
(
child:
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
runApp
(
const
Center
(
child:
Text
(
'Done'
,
textDirection:
TextDirection
.
ltr
,)));
runApp
(
const
Center
(
child:
Text
(
'Done'
,
textDirection:
TextDirection
.
ltr
,)));
},
},
...
...
packages/flutter/test/widgets/semantics_debugger_test.dart
View file @
2856d663
...
@@ -161,13 +161,13 @@ void main() {
...
@@ -161,13 +161,13 @@ void main() {
child:
Material
(
child:
Material
(
child:
ListView
(
child:
ListView
(
children:
<
Widget
>[
children:
<
Widget
>[
Rais
edButton
(
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
log
.
add
(
'top'
);
log
.
add
(
'top'
);
},
},
child:
const
Text
(
'TOP'
),
child:
const
Text
(
'TOP'
),
),
),
Rais
edButton
(
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
log
.
add
(
'bottom'
);
log
.
add
(
'bottom'
);
},
},
...
@@ -199,14 +199,14 @@ void main() {
...
@@ -199,14 +199,14 @@ void main() {
child:
Material
(
child:
Material
(
child:
ListView
(
child:
ListView
(
children:
<
Widget
>[
children:
<
Widget
>[
Rais
edButton
(
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
log
.
add
(
'top'
);
log
.
add
(
'top'
);
},
},
child:
const
Text
(
'TOP'
,
textDirection:
TextDirection
.
ltr
),
child:
const
Text
(
'TOP'
,
textDirection:
TextDirection
.
ltr
),
),
),
ExcludeSemantics
(
ExcludeSemantics
(
child:
Rais
edButton
(
child:
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
log
.
add
(
'bottom'
);
log
.
add
(
'bottom'
);
},
},
...
...
packages/flutter/test/widgets/sliver_fill_remaining_test.dart
View file @
2856d663
...
@@ -188,7 +188,7 @@ void main() {
...
@@ -188,7 +188,7 @@ void main() {
color:
Colors
.
blue
,
color:
Colors
.
blue
,
child:
Align
(
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'bottomCenter button'
),
child:
const
Text
(
'bottomCenter button'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -203,7 +203,7 @@ void main() {
...
@@ -203,7 +203,7 @@ void main() {
);
);
// Also check that the button alignment is true to expectations
// Also check that the button alignment is true to expectations
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
600.0
));
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
600.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
...
@@ -261,7 +261,7 @@ void main() {
...
@@ -261,7 +261,7 @@ void main() {
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
50.0
),
padding:
const
EdgeInsets
.
all
(
50.0
),
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'center button'
),
child:
const
Text
(
'center button'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -279,7 +279,7 @@ void main() {
...
@@ -279,7 +279,7 @@ void main() {
);
);
// Also check that the button alignment is true to expectations
// Also check that the button alignment is true to expectations
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
550.0
));
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
550.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
});
});
...
@@ -298,7 +298,7 @@ void main() {
...
@@ -298,7 +298,7 @@ void main() {
child:
Center
(
child:
FlutterLogo
(
size:
100
)),
child:
Center
(
child:
FlutterLogo
(
size:
100
)),
fit:
FlexFit
.
loose
,
fit:
FlexFit
.
loose
,
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Bottom'
),
child:
const
Text
(
'Bottom'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -322,7 +322,7 @@ void main() {
...
@@ -322,7 +322,7 @@ void main() {
expect
(
tester
.
getCenter
(
logo
),
const
Offset
(
400.0
,
351.0
));
expect
(
tester
.
getCenter
(
logo
),
const
Offset
(
400.0
,
351.0
));
// Also check that the button alignment is true to expectations
// Also check that the button alignment is true to expectations
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
expect
(
tester
.
renderObject
<
RenderBox
>(
button
).
size
,
tester
.
renderObject
<
RenderBox
>(
button
).
size
,
const
Size
(
116.0
,
48.0
),
const
Size
(
116.0
,
48.0
),
...
@@ -390,7 +390,7 @@ void main() {
...
@@ -390,7 +390,7 @@ void main() {
color:
Colors
.
blue
,
color:
Colors
.
blue
,
child:
Align
(
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'bottomCenter button'
),
child:
const
Text
(
'bottomCenter button'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -413,7 +413,7 @@ void main() {
...
@@ -413,7 +413,7 @@ void main() {
// Also check that the button alignment is true to expectations, even with
// Also check that the button alignment is true to expectations, even with
// child stretching to fill overscroll
// child stretching to fill overscroll
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
600.0
));
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
600.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
...
@@ -447,7 +447,7 @@ void main() {
...
@@ -447,7 +447,7 @@ void main() {
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
50.0
),
padding:
const
EdgeInsets
.
all
(
50.0
),
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'center button'
),
child:
const
Text
(
'center button'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -466,7 +466,7 @@ void main() {
...
@@ -466,7 +466,7 @@ void main() {
equals
(
148.0
),
equals
(
148.0
),
);
);
// Check that the button alignment is true to expectations
// Check that the button alignment is true to expectations
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
550.0
));
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
550.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
...
@@ -567,7 +567,7 @@ void main() {
...
@@ -567,7 +567,7 @@ void main() {
child:
Center
(
child:
FlutterLogo
(
size:
100
)),
child:
Center
(
child:
FlutterLogo
(
size:
100
)),
fit:
FlexFit
.
loose
,
fit:
FlexFit
.
loose
,
),
),
Rais
edButton
(
Elevat
edButton
(
child:
const
Text
(
'Bottom'
),
child:
const
Text
(
'Bottom'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -591,7 +591,7 @@ void main() {
...
@@ -591,7 +591,7 @@ void main() {
expect
(
tester
.
getCenter
(
logo
),
const
Offset
(
400.0
,
351.0
));
expect
(
tester
.
getCenter
(
logo
),
const
Offset
(
400.0
,
351.0
));
// Also check that the button alignment is true to expectations.
// Also check that the button alignment is true to expectations.
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
expect
(
tester
.
renderObject
<
RenderBox
>(
button
).
size
,
tester
.
renderObject
<
RenderBox
>(
button
).
size
,
const
Size
(
116.0
,
48.0
),
const
Size
(
116.0
,
48.0
),
...
@@ -674,7 +674,7 @@ void main() {
...
@@ -674,7 +674,7 @@ void main() {
color:
Colors
.
blue
,
color:
Colors
.
blue
,
child:
Align
(
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'bottomCenter button'
),
child:
const
Text
(
'bottomCenter button'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -696,7 +696,7 @@ void main() {
...
@@ -696,7 +696,7 @@ void main() {
);
);
// Also check that the button alignment is true to expectations
// Also check that the button alignment is true to expectations
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
600.0
));
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
600.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
});
});
...
@@ -723,7 +723,7 @@ void main() {
...
@@ -723,7 +723,7 @@ void main() {
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
50.0
),
padding:
const
EdgeInsets
.
all
(
50.0
),
child:
Rais
edButton
(
child:
Elevat
edButton
(
child:
const
Text
(
'center button'
),
child:
const
Text
(
'center button'
),
onPressed:
()
{},
onPressed:
()
{},
),
),
...
@@ -743,7 +743,7 @@ void main() {
...
@@ -743,7 +743,7 @@ void main() {
);
);
// Check that the button alignment is true to expectations
// Check that the button alignment is true to expectations
final
Finder
button
=
find
.
byType
(
Rais
edButton
);
final
Finder
button
=
find
.
byType
(
Elevat
edButton
);
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
550.0
));
expect
(
tester
.
getBottomLeft
(
button
).
dy
,
equals
(
550.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
expect
(
tester
.
getCenter
(
button
).
dx
,
equals
(
400.0
));
...
...
packages/flutter/test/widgets/widget_inspector_test.dart
View file @
2856d663
...
@@ -276,7 +276,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
...
@@ -276,7 +276,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
final
GlobalKey
topButtonKey
=
GlobalKey
();
final
GlobalKey
topButtonKey
=
GlobalKey
();
Widget
selectButtonBuilder
(
BuildContext
context
,
VoidCallback
onPressed
)
{
Widget
selectButtonBuilder
(
BuildContext
context
,
VoidCallback
onPressed
)
{
return
Material
(
child:
RaisedButton
(
onPressed:
onPressed
,
key:
selectButtonKey
));
return
Material
(
child:
ElevatedButton
(
onPressed:
onPressed
,
key:
selectButtonKey
,
child:
null
));
}
}
// State type is private, hence using dynamic.
// State type is private, hence using dynamic.
dynamic
getInspectorState
()
=>
inspectorKey
.
currentState
;
dynamic
getInspectorState
()
=>
inspectorKey
.
currentState
;
...
@@ -294,14 +294,14 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
...
@@ -294,14 +294,14 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
child:
Material
(
child:
Material
(
child:
ListView
(
child:
ListView
(
children:
<
Widget
>[
children:
<
Widget
>[
Rais
edButton
(
Elevat
edButton
(
key:
topButtonKey
,
key:
topButtonKey
,
onPressed:
()
{
onPressed:
()
{
log
.
add
(
'top'
);
log
.
add
(
'top'
);
},
},
child:
const
Text
(
'TOP'
),
child:
const
Text
(
'TOP'
),
),
),
Rais
edButton
(
Elevat
edButton
(
onPressed:
()
{
onPressed:
()
{
log
.
add
(
'bottom'
);
log
.
add
(
'bottom'
);
},
},
...
@@ -376,7 +376,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
...
@@ -376,7 +376,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
final
GlobalKey
inspectorKey
=
GlobalKey
();
final
GlobalKey
inspectorKey
=
GlobalKey
();
Widget
selectButtonBuilder
(
BuildContext
context
,
VoidCallback
onPressed
)
{
Widget
selectButtonBuilder
(
BuildContext
context
,
VoidCallback
onPressed
)
{
return
Material
(
child:
RaisedButton
(
onPressed:
onPressed
,
key:
selectButtonKey
));
return
Material
(
child:
ElevatedButton
(
onPressed:
onPressed
,
key:
selectButtonKey
,
child:
null
));
}
}
// State type is private, hence using dynamic.
// State type is private, hence using dynamic.
dynamic
getInspectorState
()
=>
inspectorKey
.
currentState
;
dynamic
getInspectorState
()
=>
inspectorKey
.
currentState
;
...
...
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