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
bb73121c
Unverified
Commit
bb73121c
authored
Jan 20, 2023
by
Michael Goderbauer
Committed by
GitHub
Jan 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary null checks in flutter/test (#118905)
parent
288a7733
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
48 additions
and
133 deletions
+48
-133
route_test.dart
packages/flutter/test/cupertino/route_test.dart
+0
-1
locking_test.dart
packages/flutter/test/gestures/locking_test.dart
+0
-2
velocity_tracker_test.dart
packages/flutter/test/gestures/velocity_tracker_test.dart
+1
-2
bottom_navigation_bar_test.dart
...ges/flutter/test/material/bottom_navigation_bar_test.dart
+0
-1
chip_test.dart
packages/flutter/test/material/chip_test.dart
+3
-3
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+0
-11
floating_action_button_location_test.dart
...r/test/material/floating_action_button_location_test.dart
+1
-3
scaffold_test.dart
packages/flutter/test/material/scaffold_test.dart
+1
-1
tooltip_test.dart
packages/flutter/test/material/tooltip_test.dart
+1
-3
tooltip_visibility_test.dart
packages/flutter/test/material/tooltip_visibility_test.dart
+2
-6
decoration_test.dart
packages/flutter/test/painting/decoration_test.dart
+0
-1
mocks_for_image_cache.dart
packages/flutter/test/painting/mocks_for_image_cache.dart
+1
-2
mock_canvas.dart
packages/flutter/test/rendering/mock_canvas.dart
+1
-1
mouse_tracker_cursor_test.dart
...ges/flutter/test/rendering/mouse_tracker_cursor_test.dart
+1
-2
mouse_tracker_test.dart
packages/flutter/test/rendering/mouse_tracker_test.dart
+4
-11
recording_canvas.dart
packages/flutter/test/rendering/recording_canvas.dart
+0
-2
rendering_tester.dart
packages/flutter/test/rendering/rendering_tester.dart
+1
-4
text_input_utils.dart
packages/flutter/test/services/text_input_utils.dart
+1
-1
actions_test.dart
packages/flutter/test/widgets/actions_test.dart
+1
-2
autocomplete_test.dart
packages/flutter/test/widgets/autocomplete_test.dart
+1
-1
baseline_test.dart
packages/flutter/test/widgets/baseline_test.dart
+1
-3
custom_multi_child_layout_test.dart
.../flutter/test/widgets/custom_multi_child_layout_test.dart
+1
-1
dismissible_test.dart
packages/flutter/test/widgets/dismissible_test.dart
+0
-4
fade_in_image_test.dart
packages/flutter/test/widgets/fade_in_image_test.dart
+1
-3
framework_test.dart
packages/flutter/test/widgets/framework_test.dart
+2
-4
gesture_detector_semantics_test.dart
...flutter/test/widgets/gesture_detector_semantics_test.dart
+1
-3
heroes_test.dart
packages/flutter/test/widgets/heroes_test.dart
+0
-1
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+0
-1
image_test.dart
packages/flutter/test/widgets/image_test.dart
+2
-8
inherited_model_test.dart
packages/flutter/test/widgets/inherited_model_test.dart
+1
-1
layout_builder_mutations_test.dart
...s/flutter/test/widgets/layout_builder_mutations_test.dart
+1
-1
linked_scroll_view_test.dart
packages/flutter/test/widgets/linked_scroll_view_test.dart
+1
-1
list_view_test.dart
packages/flutter/test/widgets/list_view_test.dart
+0
-1
mouse_region_test.dart
packages/flutter/test/widgets/mouse_region_test.dart
+1
-1
platform_menu_bar_test.dart
packages/flutter/test/widgets/platform_menu_bar_test.dart
+1
-1
render_object_element_test.dart
...ages/flutter/test/widgets/render_object_element_test.dart
+0
-1
router_test.dart
packages/flutter/test/widgets/router_test.dart
+1
-1
semantics_6_test.dart
packages/flutter/test/widgets/semantics_6_test.dart
+0
-1
semantics_tester.dart
packages/flutter/test/widgets/semantics_tester.dart
+12
-34
shortcuts_test.dart
packages/flutter/test/widgets/shortcuts_test.dart
+1
-1
test_border.dart
packages/flutter/test/widgets/test_border.dart
+1
-1
No files found.
packages/flutter/test/cupertino/route_test.dart
View file @
bb73121c
...
@@ -1830,7 +1830,6 @@ void main() {
...
@@ -1830,7 +1830,6 @@ void main() {
child:
const
Text
(
'Home'
),
child:
const
Text
(
'Home'
),
onPressed:
()
{
onPressed:
()
{
navigator
=
Navigator
.
of
(
context
);
navigator
=
Navigator
.
of
(
context
);
assert
(
navigator
!=
null
);
navigator
.
push
<
void
>(
r
);
navigator
.
push
<
void
>(
r
);
},
},
);
);
...
...
packages/flutter/test/gestures/locking_test.dart
View file @
bb73121c
...
@@ -29,7 +29,6 @@ class TestGestureFlutterBinding extends BindingBase with GestureBinding {
...
@@ -29,7 +29,6 @@ class TestGestureFlutterBinding extends BindingBase with GestureBinding {
);
);
Future
<
void
>
test
(
VoidCallback
callback
)
{
Future
<
void
>
test
(
VoidCallback
callback
)
{
assert
(
callback
!=
null
);
return
_binding
.
lockEvents
(()
async
{
return
_binding
.
lockEvents
(()
async
{
GestureBinding
.
instance
.
platformDispatcher
.
onPointerDataPacket
?.
call
(
packet
);
GestureBinding
.
instance
.
platformDispatcher
.
onPointerDataPacket
?.
call
(
packet
);
callback
();
callback
();
...
@@ -41,7 +40,6 @@ late TestGestureFlutterBinding _binding;
...
@@ -41,7 +40,6 @@ late TestGestureFlutterBinding _binding;
void
main
(
)
{
void
main
(
)
{
_binding
=
TestGestureFlutterBinding
();
_binding
=
TestGestureFlutterBinding
();
assert
(
GestureBinding
.
instance
!=
null
);
test
(
'Pointer events are locked during reassemble'
,
()
async
{
test
(
'Pointer events are locked during reassemble'
,
()
async
{
final
List
<
PointerEvent
>
events
=
<
PointerEvent
>[];
final
List
<
PointerEvent
>
events
=
<
PointerEvent
>[];
...
...
packages/flutter/test/gestures/velocity_tracker_test.dart
View file @
bb73121c
...
@@ -13,8 +13,7 @@ bool _withinTolerance(double actual, double expected) {
...
@@ -13,8 +13,7 @@ bool _withinTolerance(double actual, double expected) {
}
}
bool
_checkVelocity
(
Velocity
actual
,
Offset
expected
)
{
bool
_checkVelocity
(
Velocity
actual
,
Offset
expected
)
{
return
(
actual
!=
null
)
return
_withinTolerance
(
actual
.
pixelsPerSecond
.
dx
,
expected
.
dx
)
&&
_withinTolerance
(
actual
.
pixelsPerSecond
.
dx
,
expected
.
dx
)
&&
_withinTolerance
(
actual
.
pixelsPerSecond
.
dy
,
expected
.
dy
);
&&
_withinTolerance
(
actual
.
pixelsPerSecond
.
dy
,
expected
.
dy
);
}
}
...
...
packages/flutter/test/material/bottom_navigation_bar_test.dart
View file @
bb73121c
...
@@ -2491,7 +2491,6 @@ void main() {
...
@@ -2491,7 +2491,6 @@ void main() {
}
}
Widget
boilerplate
(
{
Widget
?
bottomNavigationBar
,
required
TextDirection
textDirection
})
{
Widget
boilerplate
(
{
Widget
?
bottomNavigationBar
,
required
TextDirection
textDirection
})
{
assert
(
textDirection
!=
null
);
return
MaterialApp
(
return
MaterialApp
(
home:
Localizations
(
home:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
locale:
const
Locale
(
'en'
,
'US'
),
...
...
packages/flutter/test/material/chip_test.dart
View file @
bb73121c
...
@@ -1506,7 +1506,7 @@ void main() {
...
@@ -1506,7 +1506,7 @@ void main() {
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
return
RawChip
(
return
RawChip
(
avatar:
avatar
,
avatar:
avatar
,
onSelected:
selectable
!=
null
onSelected:
selectable
?
(
bool
value
)
{
?
(
bool
value
)
{
setState
(()
{
setState
(()
{
selected
=
value
;
selected
=
value
;
...
@@ -1585,7 +1585,7 @@ void main() {
...
@@ -1585,7 +1585,7 @@ void main() {
children:
<
Widget
>[
children:
<
Widget
>[
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
return
RawChip
(
return
RawChip
(
onSelected:
selectable
!=
null
onSelected:
selectable
?
(
bool
value
)
{
?
(
bool
value
)
{
setState
(()
{
setState
(()
{
selected
=
value
;
selected
=
value
;
...
@@ -1659,7 +1659,7 @@ void main() {
...
@@ -1659,7 +1659,7 @@ void main() {
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
return
RawChip
(
return
RawChip
(
avatar:
avatar
,
avatar:
avatar
,
onSelected:
selectable
!=
null
onSelected:
selectable
?
(
bool
value
)
{
?
(
bool
value
)
{
setState
(()
{
setState
(()
{
selected
=
value
;
selected
=
value
;
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
bb73121c
...
@@ -717,7 +717,6 @@ void main() {
...
@@ -717,7 +717,6 @@ void main() {
expect
(
itemBoxes
.
length
,
equals
(
2
));
expect
(
itemBoxes
.
length
,
equals
(
2
));
for
(
final
RenderBox
itemBox
in
itemBoxes
)
{
for
(
final
RenderBox
itemBox
in
itemBoxes
)
{
assert
(
itemBox
.
attached
);
assert
(
itemBox
.
attached
);
assert
(
textDirection
!=
null
);
switch
(
textDirection
)
{
switch
(
textDirection
)
{
case
TextDirection
.
rtl
:
case
TextDirection
.
rtl
:
expect
(
expect
(
...
@@ -1145,13 +1144,11 @@ void main() {
...
@@ -1145,13 +1144,11 @@ void main() {
tester
.
element
(
find
.
byType
(
ListView
)).
visitAncestorElements
((
Element
element
)
{
tester
.
element
(
find
.
byType
(
ListView
)).
visitAncestorElements
((
Element
element
)
{
if
(
element
.
toString
().
startsWith
(
'_DropdownMenu'
))
{
if
(
element
.
toString
().
startsWith
(
'_DropdownMenu'
))
{
final
RenderBox
box
=
element
.
findRenderObject
()!
as
RenderBox
;
final
RenderBox
box
=
element
.
findRenderObject
()!
as
RenderBox
;
assert
(
box
!=
null
);
menuRect
=
box
.
localToGlobal
(
Offset
.
zero
)
&
box
.
size
;
menuRect
=
box
.
localToGlobal
(
Offset
.
zero
)
&
box
.
size
;
return
false
;
return
false
;
}
}
return
true
;
return
true
;
});
});
assert
(
menuRect
!=
null
);
return
menuRect
;
return
menuRect
;
}
}
...
@@ -1859,9 +1856,7 @@ void main() {
...
@@ -1859,9 +1856,7 @@ void main() {
double
getMenuScroll
()
{
double
getMenuScroll
()
{
double
scrollPosition
;
double
scrollPosition
;
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
assert
(
scrollController
!=
null
);
scrollPosition
=
scrollController
.
position
.
pixels
;
scrollPosition
=
scrollController
.
position
.
pixels
;
assert
(
scrollPosition
!=
null
);
return
scrollPosition
;
return
scrollPosition
;
}
}
...
@@ -1895,9 +1890,7 @@ void main() {
...
@@ -1895,9 +1890,7 @@ void main() {
double
getMenuScroll
()
{
double
getMenuScroll
()
{
double
scrollPosition
;
double
scrollPosition
;
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
assert
(
scrollController
!=
null
);
scrollPosition
=
scrollController
.
position
.
pixels
;
scrollPosition
=
scrollController
.
position
.
pixels
;
assert
(
scrollPosition
!=
null
);
return
scrollPosition
;
return
scrollPosition
;
}
}
...
@@ -1932,9 +1925,7 @@ void main() {
...
@@ -1932,9 +1925,7 @@ void main() {
double
getMenuScroll
()
{
double
getMenuScroll
()
{
double
scrollPosition
;
double
scrollPosition
;
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
assert
(
scrollController
!=
null
);
scrollPosition
=
scrollController
.
position
.
pixels
;
scrollPosition
=
scrollController
.
position
.
pixels
;
assert
(
scrollPosition
!=
null
);
return
scrollPosition
;
return
scrollPosition
;
}
}
...
@@ -1969,9 +1960,7 @@ void main() {
...
@@ -1969,9 +1960,7 @@ void main() {
double
getMenuScroll
()
{
double
getMenuScroll
()
{
double
scrollPosition
;
double
scrollPosition
;
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
final
ScrollController
scrollController
=
PrimaryScrollController
.
of
(
tester
.
element
(
find
.
byType
(
ListView
)));
assert
(
scrollController
!=
null
);
scrollPosition
=
scrollController
.
position
.
pixels
;
scrollPosition
=
scrollController
.
position
.
pixels
;
assert
(
scrollPosition
!=
null
);
return
scrollPosition
;
return
scrollPosition
;
}
}
...
...
packages/flutter/test/material/floating_action_button_location_test.dart
View file @
bb73121c
...
@@ -132,8 +132,7 @@ void main() {
...
@@ -132,8 +132,7 @@ void main() {
);
);
final
Iterable
<
double
>
currentRotations
=
rotationTransitions
.
map
((
RotationTransition
t
)
=>
t
.
turns
.
value
);
final
Iterable
<
double
>
currentRotations
=
rotationTransitions
.
map
((
RotationTransition
t
)
=>
t
.
turns
.
value
);
if
(
previousRotations
!=
null
&&
previousRotations
!.
isNotEmpty
if
(
previousRotations
!=
null
&&
previousRotations
!.
isNotEmpty
&&
currentRotations
.
isNotEmpty
&&
currentRotations
!=
null
&&
currentRotations
.
isNotEmpty
&&
previousRect
!=
null
&&
currentRect
!=
null
)
{
&&
previousRect
!=
null
&&
currentRect
!=
null
)
{
final
List
<
double
>
deltas
=
<
double
>[];
final
List
<
double
>
deltas
=
<
double
>[];
for
(
final
double
currentRotation
in
currentRotations
)
{
for
(
final
double
currentRotation
in
currentRotations
)
{
...
@@ -1739,7 +1738,6 @@ class _StartTopFloatingActionButtonLocation extends FloatingActionButtonLocation
...
@@ -1739,7 +1738,6 @@ class _StartTopFloatingActionButtonLocation extends FloatingActionButtonLocation
@override
@override
Offset
getOffset
(
ScaffoldPrelayoutGeometry
scaffoldGeometry
)
{
Offset
getOffset
(
ScaffoldPrelayoutGeometry
scaffoldGeometry
)
{
double
fabX
;
double
fabX
;
assert
(
scaffoldGeometry
.
textDirection
!=
null
);
switch
(
scaffoldGeometry
.
textDirection
)
{
switch
(
scaffoldGeometry
.
textDirection
)
{
case
TextDirection
.
rtl
:
case
TextDirection
.
rtl
:
final
double
startPadding
=
kFloatingActionButtonMargin
+
scaffoldGeometry
.
minInsets
.
right
;
final
double
startPadding
=
kFloatingActionButtonMargin
+
scaffoldGeometry
.
minInsets
.
right
;
...
...
packages/flutter/test/material/scaffold_test.dart
View file @
bb73121c
...
@@ -2774,7 +2774,7 @@ class _CustomPageRoute<T> extends PageRoute<T> {
...
@@ -2774,7 +2774,7 @@ class _CustomPageRoute<T> extends PageRoute<T> {
RouteSettings
super
.
settings
=
const
RouteSettings
(),
RouteSettings
super
.
settings
=
const
RouteSettings
(),
this
.
maintainState
=
true
,
this
.
maintainState
=
true
,
super
.
fullscreenDialog
,
super
.
fullscreenDialog
,
})
:
assert
(
builder
!=
null
)
;
});
final
WidgetBuilder
builder
;
final
WidgetBuilder
builder
;
...
...
packages/flutter/test/material/tooltip_test.dart
View file @
bb73121c
...
@@ -1340,9 +1340,7 @@ void main() {
...
@@ -1340,9 +1340,7 @@ void main() {
const
Duration
waitDuration
=
Duration
(
seconds:
1
);
const
Duration
waitDuration
=
Duration
(
seconds:
1
);
final
TestGesture
gesture
=
await
tester
.
createGesture
(
kind:
PointerDeviceKind
.
mouse
);
final
TestGesture
gesture
=
await
tester
.
createGesture
(
kind:
PointerDeviceKind
.
mouse
);
addTearDown
(()
async
{
addTearDown
(()
async
{
if
(
gesture
!=
null
)
{
return
gesture
.
removePointer
();
return
gesture
.
removePointer
();
}
});
});
await
gesture
.
addPointer
();
await
gesture
.
addPointer
();
await
gesture
.
moveTo
(
const
Offset
(
1.0
,
1.0
));
await
gesture
.
moveTo
(
const
Offset
(
1.0
,
1.0
));
...
...
packages/flutter/test/material/tooltip_visibility_test.dart
View file @
bb73121c
...
@@ -14,9 +14,7 @@ void main() {
...
@@ -14,9 +14,7 @@ void main() {
testWidgets
(
'Tooltip does not build MouseRegion when mouse is detected and in TooltipVisibility with visibility = false'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tooltip does not build MouseRegion when mouse is detected and in TooltipVisibility with visibility = false'
,
(
WidgetTester
tester
)
async
{
final
TestGesture
gesture
=
await
tester
.
createGesture
(
kind:
PointerDeviceKind
.
mouse
);
final
TestGesture
gesture
=
await
tester
.
createGesture
(
kind:
PointerDeviceKind
.
mouse
);
addTearDown
(()
async
{
addTearDown
(()
async
{
if
(
gesture
!=
null
)
{
return
gesture
.
removePointer
();
return
gesture
.
removePointer
();
}
});
});
await
gesture
.
addPointer
();
await
gesture
.
addPointer
();
await
gesture
.
moveTo
(
const
Offset
(
1.0
,
1.0
));
await
gesture
.
moveTo
(
const
Offset
(
1.0
,
1.0
));
...
@@ -45,9 +43,7 @@ void main() {
...
@@ -45,9 +43,7 @@ void main() {
const
Duration
waitDuration
=
Duration
.
zero
;
const
Duration
waitDuration
=
Duration
.
zero
;
final
TestGesture
gesture
=
await
tester
.
createGesture
(
kind:
PointerDeviceKind
.
mouse
);
final
TestGesture
gesture
=
await
tester
.
createGesture
(
kind:
PointerDeviceKind
.
mouse
);
addTearDown
(()
async
{
addTearDown
(()
async
{
if
(
gesture
!=
null
)
{
return
gesture
.
removePointer
();
return
gesture
.
removePointer
();
}
});
});
await
gesture
.
addPointer
();
await
gesture
.
addPointer
();
await
gesture
.
moveTo
(
const
Offset
(
1.0
,
1.0
));
await
gesture
.
moveTo
(
const
Offset
(
1.0
,
1.0
));
...
...
packages/flutter/test/painting/decoration_test.dart
View file @
bb73121c
...
@@ -240,7 +240,6 @@ void main() {
...
@@ -240,7 +240,6 @@ void main() {
test
(
'BoxDecoration backgroundImage clip'
,
()
async
{
test
(
'BoxDecoration backgroundImage clip'
,
()
async
{
final
ui
.
Image
image
=
await
createTestImage
(
width:
100
,
height:
100
);
final
ui
.
Image
image
=
await
createTestImage
(
width:
100
,
height:
100
);
void
testDecoration
({
BoxShape
shape
=
BoxShape
.
rectangle
,
BorderRadius
?
borderRadius
,
required
bool
expectClip
})
{
void
testDecoration
({
BoxShape
shape
=
BoxShape
.
rectangle
,
BorderRadius
?
borderRadius
,
required
bool
expectClip
})
{
assert
(
shape
!=
null
);
FakeAsync
().
run
((
FakeAsync
async
)
async
{
FakeAsync
().
run
((
FakeAsync
async
)
async
{
final
DelayedImageProvider
imageProvider
=
DelayedImageProvider
(
image
);
final
DelayedImageProvider
imageProvider
=
DelayedImageProvider
(
image
);
final
DecorationImage
backgroundImage
=
DecorationImage
(
image:
imageProvider
);
final
DecorationImage
backgroundImage
=
DecorationImage
(
image:
imageProvider
);
...
...
packages/flutter/test/painting/mocks_for_image_cache.dart
View file @
bb73121c
...
@@ -42,8 +42,7 @@ class TestImageInfo extends ImageInfo {
...
@@ -42,8 +42,7 @@ class TestImageInfo extends ImageInfo {
}
}
class
TestImageProvider
extends
ImageProvider
<
int
>
{
class
TestImageProvider
extends
ImageProvider
<
int
>
{
const
TestImageProvider
(
this
.
key
,
this
.
imageValue
,
{
required
this
.
image
})
const
TestImageProvider
(
this
.
key
,
this
.
imageValue
,
{
required
this
.
image
});
:
assert
(
image
!=
null
);
final
int
key
;
final
int
key
;
final
int
imageValue
;
final
int
imageValue
;
...
...
packages/flutter/test/rendering/mock_canvas.dart
View file @
bb73121c
...
@@ -498,7 +498,7 @@ class _PathMatcher extends Matcher {
...
@@ -498,7 +498,7 @@ class _PathMatcher extends Matcher {
}
}
class
_MismatchedCall
{
class
_MismatchedCall
{
const
_MismatchedCall
(
this
.
message
,
this
.
callIntroduction
,
this
.
call
)
:
assert
(
call
!=
null
)
;
const
_MismatchedCall
(
this
.
message
,
this
.
callIntroduction
,
this
.
call
);
final
String
message
;
final
String
message
;
final
String
callIntroduction
;
final
String
callIntroduction
;
final
RecordedInvocation
call
;
final
RecordedInvocation
call
;
...
...
packages/flutter/test/rendering/mouse_tracker_cursor_test.dart
View file @
bb73121c
...
@@ -448,8 +448,7 @@ ui.PointerData _pointerData(
...
@@ -448,8 +448,7 @@ ui.PointerData _pointerData(
}
}
class
_CursorUpdateDetails
extends
MethodCall
{
class
_CursorUpdateDetails
extends
MethodCall
{
const
_CursorUpdateDetails
(
super
.
method
,
Map
<
String
,
dynamic
>
super
.
arguments
)
const
_CursorUpdateDetails
(
super
.
method
,
Map
<
String
,
dynamic
>
super
.
arguments
);
:
assert
(
arguments
!=
null
);
_CursorUpdateDetails
.
wrap
(
MethodCall
call
)
_CursorUpdateDetails
.
wrap
(
MethodCall
call
)
:
super
(
call
.
method
,
Map
<
String
,
dynamic
>.
from
(
call
.
arguments
as
Map
<
dynamic
,
dynamic
>));
:
super
(
call
.
method
,
Map
<
String
,
dynamic
>.
from
(
call
.
arguments
as
Map
<
dynamic
,
dynamic
>));
...
...
packages/flutter/test/rendering/mouse_tracker_test.dart
View file @
bb73121c
...
@@ -43,19 +43,13 @@ void main() {
...
@@ -43,19 +43,13 @@ void main() {
})
{
})
{
final
TestAnnotationTarget
oneAnnotation
=
TestAnnotationTarget
(
final
TestAnnotationTarget
oneAnnotation
=
TestAnnotationTarget
(
onEnter:
(
PointerEnterEvent
event
)
{
onEnter:
(
PointerEnterEvent
event
)
{
if
(
logEvents
!=
null
)
{
logEvents
.
add
(
event
);
logEvents
.
add
(
event
);
}
},
},
onHover:
(
PointerHoverEvent
event
)
{
onHover:
(
PointerHoverEvent
event
)
{
if
(
logEvents
!=
null
)
{
logEvents
.
add
(
event
);
logEvents
.
add
(
event
);
}
},
},
onExit:
(
PointerExitEvent
event
)
{
onExit:
(
PointerExitEvent
event
)
{
if
(
logEvents
!=
null
)
{
logEvents
.
add
(
event
);
logEvents
.
add
(
event
);
}
},
},
);
);
setUpMouseAnnotationFinder
(
setUpMouseAnnotationFinder
(
...
@@ -608,8 +602,7 @@ ui.PointerData _pointerData(
...
@@ -608,8 +602,7 @@ ui.PointerData _pointerData(
}
}
class
BaseEventMatcher
extends
Matcher
{
class
BaseEventMatcher
extends
Matcher
{
BaseEventMatcher
(
this
.
expected
)
BaseEventMatcher
(
this
.
expected
);
:
assert
(
expected
!=
null
);
final
PointerEvent
expected
;
final
PointerEvent
expected
;
...
...
packages/flutter/test/rendering/recording_canvas.dart
View file @
bb73121c
...
@@ -28,7 +28,6 @@ class RecordedInvocation {
...
@@ -28,7 +28,6 @@ class RecordedInvocation {
/// Converts [stack] to a string using the [FlutterError.defaultStackFilter] logic.
/// Converts [stack] to a string using the [FlutterError.defaultStackFilter] logic.
String
stackToString
({
String
indent
=
''
})
{
String
stackToString
({
String
indent
=
''
})
{
assert
(
indent
!=
null
);
return
indent
+
FlutterError
.
defaultStackFilter
(
return
indent
+
FlutterError
.
defaultStackFilter
(
stack
.
toString
().
trimRight
().
split
(
'
\n
'
),
stack
.
toString
().
trimRight
().
split
(
'
\n
'
),
).
join
(
'
\n
$indent
'
);
).
join
(
'
\n
$indent
'
);
...
@@ -124,7 +123,6 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex
...
@@ -124,7 +123,6 @@ class TestRecordingPaintingContext extends ClipContext implements PaintingContex
Clip
clipBehavior
=
Clip
.
antiAlias
,
Clip
clipBehavior
=
Clip
.
antiAlias
,
ClipRRectLayer
?
oldLayer
,
ClipRRectLayer
?
oldLayer
,
})
{
})
{
assert
(
clipBehavior
!=
null
);
clipRRectAndPaint
(
clipRRect
.
shift
(
offset
),
clipBehavior
,
bounds
.
shift
(
offset
),
()
=>
painter
(
this
,
offset
));
clipRRectAndPaint
(
clipRRect
.
shift
(
offset
),
clipBehavior
,
bounds
.
shift
(
offset
),
()
=>
painter
(
this
,
offset
));
return
null
;
return
null
;
}
}
...
...
packages/flutter/test/rendering/rendering_tester.dart
View file @
bb73121c
...
@@ -197,13 +197,12 @@ class TestRenderingFlutterBinding extends BindingBase with SchedulerBinding, Ser
...
@@ -197,13 +197,12 @@ class TestRenderingFlutterBinding extends BindingBase with SchedulerBinding, Ser
///
///
/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError].
/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError].
void
layout
(
void
layout
(
RenderBox
box
,
{
RenderBox
box
,
{
// If you want to just repump the last box, call pumpFrame().
BoxConstraints
?
constraints
,
BoxConstraints
?
constraints
,
Alignment
alignment
=
Alignment
.
center
,
Alignment
alignment
=
Alignment
.
center
,
EnginePhase
phase
=
EnginePhase
.
layout
,
EnginePhase
phase
=
EnginePhase
.
layout
,
VoidCallback
?
onErrors
,
VoidCallback
?
onErrors
,
})
{
})
{
assert
(
box
!=
null
);
// If you want to just repump the last box, call pumpFrame().
assert
(
box
.
parent
==
null
);
// We stick the box in another, so you can't reuse it easily, sorry.
assert
(
box
.
parent
==
null
);
// We stick the box in another, so you can't reuse it easily, sorry.
TestRenderingFlutterBinding
.
instance
.
renderView
.
child
=
null
;
TestRenderingFlutterBinding
.
instance
.
renderView
.
child
=
null
;
...
@@ -225,8 +224,6 @@ void layout(
...
@@ -225,8 +224,6 @@ void layout(
///
///
/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError].
/// If `onErrors` is not null, it is set as [TestRenderingFlutterBinding.onError].
void
pumpFrame
(
{
EnginePhase
phase
=
EnginePhase
.
layout
,
VoidCallback
?
onErrors
})
{
void
pumpFrame
(
{
EnginePhase
phase
=
EnginePhase
.
layout
,
VoidCallback
?
onErrors
})
{
assert
(
TestRenderingFlutterBinding
.
instance
!=
null
);
assert
(
TestRenderingFlutterBinding
.
instance
.
renderView
!=
null
);
assert
(
TestRenderingFlutterBinding
.
instance
.
renderView
.
child
!=
null
);
// call layout() first!
assert
(
TestRenderingFlutterBinding
.
instance
.
renderView
.
child
!=
null
);
// call layout() first!
if
(
onErrors
!=
null
)
{
if
(
onErrors
!=
null
)
{
...
...
packages/flutter/test/services/text_input_utils.dart
View file @
bb73121c
...
@@ -8,7 +8,7 @@ import 'package:flutter/services.dart';
...
@@ -8,7 +8,7 @@ import 'package:flutter/services.dart';
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
class
FakeTextChannel
implements
MethodChannel
{
class
FakeTextChannel
implements
MethodChannel
{
FakeTextChannel
(
this
.
outgoing
)
:
assert
(
outgoing
!=
null
)
;
FakeTextChannel
(
this
.
outgoing
);
Future
<
dynamic
>
Function
(
MethodCall
)
outgoing
;
Future
<
dynamic
>
Function
(
MethodCall
)
outgoing
;
Future
<
void
>
Function
(
MethodCall
)?
incoming
;
Future
<
void
>
Function
(
MethodCall
)?
incoming
;
...
...
packages/flutter/test/widgets/actions_test.dart
View file @
bb73121c
...
@@ -1869,8 +1869,7 @@ class ThirdTestIntent extends SecondTestIntent {
...
@@ -1869,8 +1869,7 @@ class ThirdTestIntent extends SecondTestIntent {
class
TestAction
extends
CallbackAction
<
TestIntent
>
{
class
TestAction
extends
CallbackAction
<
TestIntent
>
{
TestAction
({
TestAction
({
required
OnInvokeCallback
onInvoke
,
required
OnInvokeCallback
onInvoke
,
})
:
assert
(
onInvoke
!=
null
),
})
:
super
(
onInvoke:
onInvoke
);
super
(
onInvoke:
onInvoke
);
@override
@override
bool
isEnabled
(
TestIntent
intent
)
=>
enabled
;
bool
isEnabled
(
TestIntent
intent
)
=>
enabled
;
...
...
packages/flutter/test/widgets/autocomplete_test.dart
View file @
bb73121c
...
@@ -507,7 +507,7 @@ void main() {
...
@@ -507,7 +507,7 @@ void main() {
home:
Scaffold
(
home:
Scaffold
(
body:
RawAutocomplete
<
String
>(
body:
RawAutocomplete
<
String
>(
optionsBuilder:
(
TextEditingValue
textEditingValue
)
{
optionsBuilder:
(
TextEditingValue
textEditingValue
)
{
if
(
textEditingValue
.
text
==
null
||
textEditingValue
.
text
==
''
)
{
if
(
textEditingValue
.
text
==
''
)
{
return
const
Iterable
<
String
>.
empty
();
return
const
Iterable
<
String
>.
empty
();
}
}
return
kOptions
.
where
((
String
option
)
{
return
kOptions
.
where
((
String
option
)
{
...
...
packages/flutter/test/widgets/baseline_test.dart
View file @
bb73121c
...
@@ -151,9 +151,7 @@ class RenderBaselineDetector extends RenderBox {
...
@@ -151,9 +151,7 @@ class RenderBaselineDetector extends RenderBox {
@override
@override
double
computeDistanceToActualBaseline
(
TextBaseline
baseline
)
{
double
computeDistanceToActualBaseline
(
TextBaseline
baseline
)
{
if
(
callback
!=
null
)
{
callback
();
callback
();
}
return
20.0
;
return
20.0
;
}
}
...
...
packages/flutter/test/widgets/custom_multi_child_layout_test.dart
View file @
bb73121c
...
@@ -153,7 +153,7 @@ class LayoutWithMissingId extends ParentDataWidget<MultiChildLayoutParentData> {
...
@@ -153,7 +153,7 @@ class LayoutWithMissingId extends ParentDataWidget<MultiChildLayoutParentData> {
const
LayoutWithMissingId
({
const
LayoutWithMissingId
({
super
.
key
,
super
.
key
,
required
super
.
child
,
required
super
.
child
,
})
:
assert
(
child
!=
null
)
;
});
@override
@override
void
applyParentData
(
RenderObject
renderObject
)
{}
void
applyParentData
(
RenderObject
renderObject
)
{}
...
...
packages/flutter/test/widgets/dismissible_test.dart
View file @
bb73121c
...
@@ -174,7 +174,6 @@ Future<void> dismissItem(
...
@@ -174,7 +174,6 @@ Future<void> dismissItem(
required
AxisDirection
gestureDirection
,
required
AxisDirection
gestureDirection
,
DismissMethod
mechanism
=
dismissElement
,
DismissMethod
mechanism
=
dismissElement
,
})
async
{
})
async
{
assert
(
gestureDirection
!=
null
);
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
expect
(
itemFinder
,
findsOneWidget
);
expect
(
itemFinder
,
findsOneWidget
);
...
@@ -188,7 +187,6 @@ Future<void> dragItem(
...
@@ -188,7 +187,6 @@ Future<void> dragItem(
required
AxisDirection
gestureDirection
,
required
AxisDirection
gestureDirection
,
required
double
amount
,
required
double
amount
,
})
async
{
})
async
{
assert
(
gestureDirection
!=
null
);
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
expect
(
itemFinder
,
findsOneWidget
);
expect
(
itemFinder
,
findsOneWidget
);
...
@@ -202,7 +200,6 @@ Future<void> checkFlingItemBeforeMovementEnd(
...
@@ -202,7 +200,6 @@ Future<void> checkFlingItemBeforeMovementEnd(
required
AxisDirection
gestureDirection
,
required
AxisDirection
gestureDirection
,
DismissMethod
mechanism
=
rollbackElement
,
DismissMethod
mechanism
=
rollbackElement
,
})
async
{
})
async
{
assert
(
gestureDirection
!=
null
);
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
expect
(
itemFinder
,
findsOneWidget
);
expect
(
itemFinder
,
findsOneWidget
);
...
@@ -218,7 +215,6 @@ Future<void> checkFlingItemAfterMovement(
...
@@ -218,7 +215,6 @@ Future<void> checkFlingItemAfterMovement(
required
AxisDirection
gestureDirection
,
required
AxisDirection
gestureDirection
,
DismissMethod
mechanism
=
rollbackElement
,
DismissMethod
mechanism
=
rollbackElement
,
})
async
{
})
async
{
assert
(
gestureDirection
!=
null
);
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
final
Finder
itemFinder
=
find
.
text
(
item
.
toString
());
expect
(
itemFinder
,
findsOneWidget
);
expect
(
itemFinder
,
findsOneWidget
);
...
...
packages/flutter/test/widgets/fade_in_image_test.dart
View file @
bb73121c
...
@@ -15,9 +15,7 @@ import '../painting/image_test_utils.dart';
...
@@ -15,9 +15,7 @@ import '../painting/image_test_utils.dart';
const
Duration
animationDuration
=
Duration
(
milliseconds:
50
);
const
Duration
animationDuration
=
Duration
(
milliseconds:
50
);
class
FadeInImageParts
{
class
FadeInImageParts
{
const
FadeInImageParts
(
this
.
fadeInImageElement
,
this
.
placeholder
,
this
.
target
)
const
FadeInImageParts
(
this
.
fadeInImageElement
,
this
.
placeholder
,
this
.
target
);
:
assert
(
fadeInImageElement
!=
null
),
assert
(
target
!=
null
);
final
ComponentElement
fadeInImageElement
;
final
ComponentElement
fadeInImageElement
;
final
FadeInImageElements
?
placeholder
;
final
FadeInImageElements
?
placeholder
;
...
...
packages/flutter/test/widgets/framework_test.dart
View file @
bb73121c
...
@@ -1810,9 +1810,7 @@ class Decorate extends StatefulWidget {
...
@@ -1810,9 +1810,7 @@ class Decorate extends StatefulWidget {
super
.
key
,
super
.
key
,
required
this
.
didChangeDependencies
,
required
this
.
didChangeDependencies
,
required
this
.
build
,
required
this
.
build
,
})
:
});
assert
(
didChangeDependencies
!=
null
),
assert
(
build
!=
null
);
final
void
Function
(
bool
isInBuild
)
didChangeDependencies
;
final
void
Function
(
bool
isInBuild
)
didChangeDependencies
;
final
void
Function
(
bool
isInBuild
)
build
;
final
void
Function
(
bool
isInBuild
)
build
;
...
@@ -1974,7 +1972,7 @@ class StatelessWidgetSpy extends StatelessWidget {
...
@@ -1974,7 +1972,7 @@ class StatelessWidgetSpy extends StatelessWidget {
const
StatelessWidgetSpy
({
const
StatelessWidgetSpy
({
super
.
key
,
super
.
key
,
required
this
.
onBuild
,
required
this
.
onBuild
,
})
:
assert
(
onBuild
!=
null
)
;
});
final
void
Function
(
BuildContext
)
onBuild
;
final
void
Function
(
BuildContext
)
onBuild
;
...
...
packages/flutter/test/widgets/gesture_detector_semantics_test.dart
View file @
bb73121c
...
@@ -725,9 +725,7 @@ class _RenderTestLayoutPerformer extends RenderBox {
...
@@ -725,9 +725,7 @@ class _RenderTestLayoutPerformer extends RenderBox {
@override
@override
void
performLayout
()
{
void
performLayout
()
{
size
=
const
Size
(
1
,
1
);
size
=
const
Size
(
1
,
1
);
if
(
_performLayout
!=
null
)
{
_performLayout
();
_performLayout
();
}
}
}
}
}
...
...
packages/flutter/test/widgets/heroes_test.dart
View file @
bb73121c
...
@@ -205,7 +205,6 @@ class FakeWindowPadding implements WindowPadding {
...
@@ -205,7 +205,6 @@ class FakeWindowPadding implements WindowPadding {
Future
<
void
>
main
()
async
{
Future
<
void
>
main
()
async
{
final
ui
.
Image
testImage
=
await
createTestImage
();
final
ui
.
Image
testImage
=
await
createTestImage
();
assert
(
testImage
!=
null
);
setUp
(()
{
setUp
(()
{
transitionFromUserGestures
=
false
;
transitionFromUserGestures
=
false
;
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
bb73121c
...
@@ -89,7 +89,6 @@ class TestAssetImage extends AssetImage {
...
@@ -89,7 +89,6 @@ class TestAssetImage extends AssetImage {
late
ImageInfo
imageInfo
;
late
ImageInfo
imageInfo
;
key
.
bundle
.
load
(
key
.
name
).
then
<
void
>((
ByteData
data
)
{
key
.
bundle
.
load
(
key
.
name
).
then
<
void
>((
ByteData
data
)
{
final
ui
.
Image
image
=
images
[
scaleOf
(
data
)]!;
final
ui
.
Image
image
=
images
[
scaleOf
(
data
)]!;
assert
(
image
!=
null
,
'Expected
${scaleOf(data)}
to have a key in
$images
'
);
imageInfo
=
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
imageInfo
=
ImageInfo
(
image:
image
,
scale:
key
.
scale
);
});
});
return
FakeImageStreamCompleter
(
return
FakeImageStreamCompleter
(
...
...
packages/flutter/test/widgets/image_test.dart
View file @
bb73121c
...
@@ -2031,9 +2031,7 @@ void main() {
...
@@ -2031,9 +2031,7 @@ void main() {
@immutable
@immutable
class
_ConfigurationAwareKey
{
class
_ConfigurationAwareKey
{
const
_ConfigurationAwareKey
(
this
.
provider
,
this
.
configuration
)
const
_ConfigurationAwareKey
(
this
.
provider
,
this
.
configuration
);
:
assert
(
provider
!=
null
),
assert
(
configuration
!=
null
);
final
ImageProvider
provider
;
final
ImageProvider
provider
;
final
ImageConfiguration
configuration
;
final
ImageConfiguration
configuration
;
...
@@ -2184,11 +2182,7 @@ class _FailingImageProvider extends ImageProvider<int> {
...
@@ -2184,11 +2182,7 @@ class _FailingImageProvider extends ImageProvider<int> {
this
.
failOnLoad
=
false
,
this
.
failOnLoad
=
false
,
required
this
.
throws
,
required
this
.
throws
,
required
this
.
image
,
required
this
.
image
,
})
:
assert
(
failOnLoad
!=
null
),
})
:
assert
(
failOnLoad
==
true
||
failOnObtainKey
==
true
);
assert
(
failOnObtainKey
!=
null
),
assert
(
failOnLoad
==
true
||
failOnObtainKey
==
true
),
assert
(
throws
!=
null
),
assert
(
image
!=
null
);
final
bool
failOnObtainKey
;
final
bool
failOnObtainKey
;
final
bool
failOnLoad
;
final
bool
failOnLoad
;
...
...
packages/flutter/test/widgets/inherited_model_test.dart
View file @
bb73121c
...
@@ -31,7 +31,7 @@ class ABCModel extends InheritedModel<String> {
...
@@ -31,7 +31,7 @@ class ABCModel extends InheritedModel<String> {
@override
@override
bool
isSupportedAspect
(
Object
aspect
)
{
bool
isSupportedAspect
(
Object
aspect
)
{
return
aspect
==
null
||
aspect
s
==
null
||
aspects
!.
contains
(
aspect
);
return
aspects
==
null
||
aspects
!.
contains
(
aspect
);
}
}
@override
@override
...
...
packages/flutter/test/widgets/layout_builder_mutations_test.dart
View file @
bb73121c
...
@@ -16,7 +16,7 @@ class Wrapper extends StatelessWidget {
...
@@ -16,7 +16,7 @@ class Wrapper extends StatelessWidget {
const
Wrapper
({
const
Wrapper
({
super
.
key
,
super
.
key
,
required
this
.
child
,
required
this
.
child
,
})
:
assert
(
child
!=
null
)
;
});
final
Widget
child
;
final
Widget
child
;
...
...
packages/flutter/test/widgets/linked_scroll_view_test.dart
View file @
bb73121c
...
@@ -111,7 +111,7 @@ class LinkedScrollPosition extends ScrollPositionWithSingleContext {
...
@@ -111,7 +111,7 @@ class LinkedScrollPosition extends ScrollPositionWithSingleContext {
required
super
.
context
,
required
super
.
context
,
required
double
super
.
initialPixels
,
required
double
super
.
initialPixels
,
super
.
oldPosition
,
super
.
oldPosition
,
})
:
assert
(
owner
!=
null
)
;
});
final
LinkedScrollController
owner
;
final
LinkedScrollController
owner
;
...
...
packages/flutter/test/widgets/list_view_test.dart
View file @
bb73121c
...
@@ -662,7 +662,6 @@ void main() {
...
@@ -662,7 +662,6 @@ void main() {
final
ScrollController
controller
=
ScrollController
();
final
ScrollController
controller
=
ScrollController
();
Widget
buildListView
({
required
Axis
scrollDirection
})
{
Widget
buildListView
({
required
Axis
scrollDirection
})
{
assert
(
scrollDirection
!=
null
);
return
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
Center
(
...
...
packages/flutter/test/widgets/mouse_region_test.dart
View file @
bb73121c
...
@@ -1930,7 +1930,7 @@ class _HoverClientWithClosuresState extends State<_HoverClientWithClosures> {
...
@@ -1930,7 +1930,7 @@ class _HoverClientWithClosuresState extends State<_HoverClientWithClosures> {
class
_ColumnContainer
extends
StatelessWidget
{
class
_ColumnContainer
extends
StatelessWidget
{
const
_ColumnContainer
({
const
_ColumnContainer
({
required
this
.
children
,
required
this
.
children
,
})
:
assert
(
children
!=
null
)
;
});
final
List
<
Widget
>
children
;
final
List
<
Widget
>
children
;
...
...
packages/flutter/test/widgets/platform_menu_bar_test.dart
View file @
bb73121c
...
@@ -390,7 +390,7 @@ List<PlatformMenuItem> createTestMenus({
...
@@ -390,7 +390,7 @@ List<PlatformMenuItem> createTestMenus({
}
}
class
FakeMenuChannel
implements
MethodChannel
{
class
FakeMenuChannel
implements
MethodChannel
{
FakeMenuChannel
(
this
.
outgoing
)
:
assert
(
outgoing
!=
null
)
;
FakeMenuChannel
(
this
.
outgoing
);
Future
<
dynamic
>
Function
(
MethodCall
)
outgoing
;
Future
<
dynamic
>
Function
(
MethodCall
)
outgoing
;
Future
<
void
>
Function
(
MethodCall
)?
incoming
;
Future
<
void
>
Function
(
MethodCall
)?
incoming
;
...
...
packages/flutter/test/widgets/render_object_element_test.dart
View file @
bb73121c
...
@@ -113,7 +113,6 @@ class SwapperElementWithProperOverrides extends SwapperElement {
...
@@ -113,7 +113,6 @@ class SwapperElementWithProperOverrides extends SwapperElement {
@override
@override
void
insertRenderObjectChild
(
RenderBox
child
,
Object
?
slot
)
{
void
insertRenderObjectChild
(
RenderBox
child
,
Object
?
slot
)
{
insertSlots
.
add
(
slot
);
insertSlots
.
add
(
slot
);
assert
(
child
!=
null
);
if
(
slot
==
'stable'
)
{
if
(
slot
==
'stable'
)
{
renderObject
.
stable
=
child
;
renderObject
.
stable
=
child
;
}
else
{
}
else
{
...
...
packages/flutter/test/widgets/router_test.dart
View file @
bb73121c
...
@@ -778,7 +778,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
...
@@ -778,7 +778,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
final
SimpleRouterDelegate
delegate
=
SimpleRouterDelegate
(
final
SimpleRouterDelegate
delegate
=
SimpleRouterDelegate
(
builder:
(
BuildContext
context
,
RouteInformation
?
information
)
{
builder:
(
BuildContext
context
,
RouteInformation
?
information
)
{
final
List
<
Widget
>
children
=
<
Widget
>[];
final
List
<
Widget
>
children
=
<
Widget
>[];
if
(
information
!.
location
!
!=
null
)
{
if
(
information
!.
location
!=
null
)
{
children
.
add
(
Text
(
information
.
location
!));
children
.
add
(
Text
(
information
.
location
!));
}
}
if
(
information
.
state
!=
null
)
{
if
(
information
.
state
!=
null
)
{
...
...
packages/flutter/test/widgets/semantics_6_test.dart
View file @
bb73121c
...
@@ -48,7 +48,6 @@ void main() {
...
@@ -48,7 +48,6 @@ void main() {
}
}
Widget
buildWidget
(
{
required
String
blockedText
,
bool
blocking
=
true
})
{
Widget
buildWidget
(
{
required
String
blockedText
,
bool
blocking
=
true
})
{
assert
(
blockedText
!=
null
);
return
Directionality
(
return
Directionality
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
child:
Stack
(
child:
Stack
(
...
...
packages/flutter/test/widgets/semantics_tester.dart
View file @
bb73121c
...
@@ -53,12 +53,6 @@ class TestSemantics {
...
@@ -53,12 +53,6 @@ class TestSemantics {
Iterable
<
SemanticsTag
>?
tags
,
Iterable
<
SemanticsTag
>?
tags
,
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
label
!=
null
),
assert
(
value
!=
null
),
assert
(
increasedValue
!=
null
),
assert
(
decreasedValue
!=
null
),
assert
(
hint
!=
null
),
assert
(
children
!=
null
),
tags
=
tags
?.
toSet
()
??
<
SemanticsTag
>{};
tags
=
tags
?.
toSet
()
??
<
SemanticsTag
>{};
/// Creates an object with some test semantics data, with the [id] and [rect]
/// Creates an object with some test semantics data, with the [id] and [rect]
...
@@ -82,15 +76,9 @@ class TestSemantics {
...
@@ -82,15 +76,9 @@ class TestSemantics {
})
:
id
=
0
,
})
:
id
=
0
,
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
label
!=
null
),
assert
(
increasedValue
!=
null
),
assert
(
decreasedValue
!=
null
),
assert
(
value
!=
null
),
assert
(
hint
!=
null
),
rect
=
TestSemantics
.
rootRect
,
rect
=
TestSemantics
.
rootRect
,
elevation
=
0.0
,
elevation
=
0.0
,
thickness
=
0.0
,
thickness
=
0.0
,
assert
(
children
!=
null
),
tags
=
tags
?.
toSet
()
??
<
SemanticsTag
>{};
tags
=
tags
?.
toSet
()
??
<
SemanticsTag
>{};
/// Creates an object with some test semantics data, with the [id] and [rect]
/// Creates an object with some test semantics data, with the [id] and [rect]
...
@@ -125,13 +113,7 @@ class TestSemantics {
...
@@ -125,13 +113,7 @@ class TestSemantics {
Iterable
<
SemanticsTag
>?
tags
,
Iterable
<
SemanticsTag
>?
tags
,
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
label
!=
null
),
assert
(
value
!=
null
),
assert
(
increasedValue
!=
null
),
assert
(
decreasedValue
!=
null
),
assert
(
hint
!=
null
),
transform
=
_applyRootChildScale
(
transform
),
transform
=
_applyRootChildScale
(
transform
),
assert
(
children
!=
null
),
tags
=
tags
?.
toSet
()
??
<
SemanticsTag
>{};
tags
=
tags
?.
toSet
()
??
<
SemanticsTag
>{};
/// The unique identifier for this node.
/// The unique identifier for this node.
...
@@ -381,22 +363,22 @@ class TestSemantics {
...
@@ -381,22 +363,22 @@ class TestSemantics {
if
(
actions
is
int
&&
actions
!=
0
||
actions
is
List
<
SemanticsAction
>
&&
(
actions
as
List
<
SemanticsAction
>).
isNotEmpty
)
{
if
(
actions
is
int
&&
actions
!=
0
||
actions
is
List
<
SemanticsAction
>
&&
(
actions
as
List
<
SemanticsAction
>).
isNotEmpty
)
{
buf
.
writeln
(
'
$indent
actions:
${SemanticsTester._actionsToSemanticsActionExpression(actions)}
,'
);
buf
.
writeln
(
'
$indent
actions:
${SemanticsTester._actionsToSemanticsActionExpression(actions)}
,'
);
}
}
if
(
label
!=
null
&&
label
!=
''
)
{
if
(
label
!=
''
)
{
buf
.
writeln
(
"
$indent
label: '
$label
',"
);
buf
.
writeln
(
"
$indent
label: '
$label
',"
);
}
}
if
(
value
!=
null
&&
value
!=
''
)
{
if
(
value
!=
''
)
{
buf
.
writeln
(
"
$indent
value: '
$value
',"
);
buf
.
writeln
(
"
$indent
value: '
$value
',"
);
}
}
if
(
increasedValue
!=
null
&&
increasedValue
!=
''
)
{
if
(
increasedValue
!=
''
)
{
buf
.
writeln
(
"
$indent
increasedValue: '
$increasedValue
',"
);
buf
.
writeln
(
"
$indent
increasedValue: '
$increasedValue
',"
);
}
}
if
(
decreasedValue
!=
null
&&
decreasedValue
!=
''
)
{
if
(
decreasedValue
!=
''
)
{
buf
.
writeln
(
"
$indent
decreasedValue: '
$decreasedValue
',"
);
buf
.
writeln
(
"
$indent
decreasedValue: '
$decreasedValue
',"
);
}
}
if
(
hint
!=
null
&&
hint
!=
''
)
{
if
(
hint
!=
''
)
{
buf
.
writeln
(
"
$indent
hint: '
$hint
',"
);
buf
.
writeln
(
"
$indent
hint: '
$hint
',"
);
}
}
if
(
tooltip
!=
null
&&
tooltip
!=
''
)
{
if
(
tooltip
!=
''
)
{
buf
.
writeln
(
"
$indent
tooltip: '
$tooltip
',"
);
buf
.
writeln
(
"
$indent
tooltip: '
$tooltip
',"
);
}
}
if
(
textDirection
!=
null
)
{
if
(
textDirection
!=
null
)
{
...
@@ -690,21 +672,21 @@ class SemanticsTester {
...
@@ -690,21 +672,21 @@ class SemanticsTester {
if (nodeData.actions != 0) {
if (nodeData.actions != 0) {
buf.writeln(' actions:
${_actionsToSemanticsActionExpression(nodeData.actions)}
,');
buf.writeln(' actions:
${_actionsToSemanticsActionExpression(nodeData.actions)}
,');
}
}
if (node.label
!= null && node.label
.isNotEmpty) {
if (node.label.isNotEmpty) {
// Escape newlines and text directionality control characters.
// Escape newlines and text directionality control characters.
final String escapedLabel = node.label.replaceAll('
\n
', r'
\n
').replaceAll('
\
u202a', r'
\
u202a').replaceAll('
\
u202c', r'
\
u202c');
final String escapedLabel = node.label.replaceAll('
\n
', r'
\n
').replaceAll('
\
u202a', r'
\
u202a').replaceAll('
\
u202c', r'
\
u202c');
buf.writeln("
label:
'
$escapedLabel
'
,
");
buf.writeln("
label:
'
$escapedLabel
'
,
");
}
}
if (node.value
!= null && node.value
.isNotEmpty) {
if (node.value.isNotEmpty) {
buf.writeln("
value:
'
${node.value}
'
,
");
buf.writeln("
value:
'
${node.value}
'
,
");
}
}
if (node.increasedValue
!= null && node.increasedValue
.isNotEmpty) {
if (node.increasedValue.isNotEmpty) {
buf.writeln("
increasedValue:
'
${node.increasedValue}
'
,
");
buf.writeln("
increasedValue:
'
${node.increasedValue}
'
,
");
}
}
if (node.decreasedValue
!= null && node.decreasedValue
.isNotEmpty) {
if (node.decreasedValue.isNotEmpty) {
buf.writeln("
decreasedValue:
'
${node.decreasedValue}
'
,
");
buf.writeln("
decreasedValue:
'
${node.decreasedValue}
'
,
");
}
}
if (node.hint
!= null && node.hint
.isNotEmpty) {
if (node.hint.isNotEmpty) {
buf.writeln("
hint:
'
${node.hint}
'
,
");
buf.writeln("
hint:
'
${node.hint}
'
,
");
}
}
if (node.textDirection != null) {
if (node.textDirection != null) {
...
@@ -732,11 +714,7 @@ class _HasSemantics extends Matcher {
...
@@ -732,11 +714,7 @@ class _HasSemantics extends Matcher {
required this.ignoreTransform,
required this.ignoreTransform,
required this.ignoreId,
required this.ignoreId,
required this.childOrder,
required this.childOrder,
}) : assert(_semantics != null),
});
assert(ignoreRect != null),
assert(ignoreId != null),
assert(ignoreTransform != null),
assert(childOrder != null);
final TestSemantics _semantics;
final TestSemantics _semantics;
final bool ignoreRect;
final bool ignoreRect;
...
...
packages/flutter/test/widgets/shortcuts_test.dart
View file @
bb73121c
...
@@ -1908,7 +1908,7 @@ class _TestCallbackRegistrationState extends State<TestCallbackRegistration> {
...
@@ -1908,7 +1908,7 @@ class _TestCallbackRegistrationState extends State<TestCallbackRegistration> {
class
TestAction
extends
CallbackAction
<
Intent
>
{
class
TestAction
extends
CallbackAction
<
Intent
>
{
TestAction
({
TestAction
({
required
super
.
onInvoke
,
required
super
.
onInvoke
,
})
:
assert
(
onInvoke
!=
null
)
;
});
static
const
LocalKey
key
=
ValueKey
<
Type
>(
TestAction
);
static
const
LocalKey
key
=
ValueKey
<
Type
>(
TestAction
);
}
}
...
...
packages/flutter/test/widgets/test_border.dart
View file @
bb73121c
...
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
...
@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
typedef
Logger
=
void
Function
(
String
caller
);
typedef
Logger
=
void
Function
(
String
caller
);
class
TestBorder
extends
ShapeBorder
{
class
TestBorder
extends
ShapeBorder
{
const
TestBorder
(
this
.
onLog
)
:
assert
(
onLog
!=
null
)
;
const
TestBorder
(
this
.
onLog
);
final
Logger
onLog
;
final
Logger
onLog
;
...
...
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