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
87f88734
Unverified
Commit
87f88734
authored
Dec 14, 2021
by
Sam Rawlins
Committed by
GitHub
Dec 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicit null returns in flutter/test (#94834)
parent
da6e5297
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
58 additions
and
4 deletions
+58
-4
picker_test.dart
packages/flutter/test/cupertino/picker_test.dart
+2
-0
refresh_test.dart
packages/flutter/test/cupertino/refresh_test.dart
+1
-0
scrollbar_test.dart
packages/flutter/test/cupertino/scrollbar_test.dart
+2
-0
switch_test.dart
packages/flutter/test/cupertino/switch_test.dart
+4
-0
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+3
-0
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+1
-0
first_frame_test.dart
packages/flutter/test/rendering/first_frame_test.dart
+1
-0
mouse_tracker_cursor_test.dart
...ges/flutter/test/rendering/mouse_tracker_cursor_test.dart
+3
-1
default_binary_messenger_test.dart
.../flutter/test/services/default_binary_messenger_test.dart
+1
-0
deferred_component_test.dart
packages/flutter/test/services/deferred_component_test.dart
+2
-0
haptic_feedback_test.dart
packages/flutter/test/services/haptic_feedback_test.dart
+2
-0
restoration_test.dart
packages/flutter/test/services/restoration_test.dart
+1
-0
system_chrome_test.dart
packages/flutter/test/services/system_chrome_test.dart
+8
-0
system_navigator_test.dart
packages/flutter/test/services/system_navigator_test.dart
+2
-0
system_sound_test.dart
packages/flutter/test/services/system_sound_test.dart
+1
-0
draggable_test.dart
packages/flutter/test/widgets/draggable_test.dart
+1
-0
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+14
-2
modal_barrier_test.dart
packages/flutter/test/widgets/modal_barrier_test.dart
+3
-1
mouse_region_test.dart
packages/flutter/test/widgets/mouse_region_test.dart
+1
-0
route_notification_messages_test.dart
...lutter/test/widgets/route_notification_messages_test.dart
+5
-0
No files found.
packages/flutter/test/cupertino/picker_test.dart
View file @
87f88734
...
...
@@ -226,6 +226,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
systemCalls
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
@@ -279,6 +280,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
systemCalls
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/cupertino/refresh_test.dart
View file @
87f88734
...
...
@@ -177,6 +177,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
platformCallLog
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/cupertino/scrollbar_test.dart
View file @
87f88734
...
...
@@ -137,6 +137,7 @@ void main() {
if
(
methodCall
.
method
==
'HapticFeedback.vibrate'
)
{
hapticFeedbackCalls
+=
1
;
}
return
null
;
});
// Long press on the scrollbar thumb and expect a vibration after it resizes.
...
...
@@ -777,6 +778,7 @@ void main() {
if
(
methodCall
.
method
==
'HapticFeedback.vibrate'
)
{
hapticFeedbackCalls
+=
1
;
}
return
null
;
});
// Long press on the scrollbar thumb and expect a vibration after it resizes.
...
...
packages/flutter/test/cupertino/switch_test.dart
View file @
87f88734
...
...
@@ -53,6 +53,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
@@ -93,6 +94,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
@@ -160,6 +162,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
@@ -198,6 +201,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
87f88734
...
...
@@ -3248,6 +3248,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
@@ -3271,6 +3272,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
...
...
@@ -4359,6 +4361,7 @@ void main() {
actions:
<
Type
,
Action
<
Intent
>>{
ScrollIntent:
CallbackAction
<
ScrollIntent
>(
onInvoke:
(
Intent
intent
)
{
scrollInvoked
=
true
;
return
null
;
}),
},
child:
ListView
(
...
...
packages/flutter/test/material/text_field_test.dart
View file @
87f88734
...
...
@@ -9841,6 +9841,7 @@ void main() {
actions:
<
Type
,
Action
<
Intent
>>{
ScrollIntent:
CallbackAction
<
ScrollIntent
>(
onInvoke:
(
Intent
intent
)
{
scrollInvoked
=
true
;
return
null
;
}),
},
child:
Material
(
...
...
packages/flutter/test/rendering/first_frame_test.dart
View file @
87f88734
...
...
@@ -18,6 +18,7 @@ void main() {
const
MethodChannel
firstFrameChannel
=
MethodChannel
(
'flutter/service_worker'
);
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
firstFrameChannel
,
(
MethodCall
methodCall
)
async
{
completer
.
complete
();
return
null
;
});
binding
.
handleBeginFrame
(
Duration
.
zero
);
...
...
packages/flutter/test/rendering/mouse_tracker_cursor_test.dart
View file @
87f88734
...
...
@@ -57,8 +57,10 @@ void main() {
setUp
(()
{
_binding
.
postFrameCallbacks
.
clear
();
_binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
mouseCursor
,
(
MethodCall
call
)
async
{
if
(
_methodCallHandler
!=
null
)
if
(
_methodCallHandler
!=
null
)
{
return
_methodCallHandler
!(
call
);
}
return
null
;
});
});
...
...
packages/flutter/test/services/default_binary_messenger_test.dart
View file @
87f88734
...
...
@@ -41,6 +41,7 @@ void main() {
(
ByteData
?
message
)
async
{
expect
(
message
,
bar
);
countInbound
+=
1
;
return
null
;
},
);
expect
(
countInbound
,
equals
(
0
));
...
...
packages/flutter/test/services/deferred_component_test.dart
View file @
87f88734
...
...
@@ -13,6 +13,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
deferredComponent
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
DeferredComponent
.
installDeferredComponent
(
componentName:
'testComponentName'
);
...
...
@@ -29,6 +30,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
deferredComponent
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
DeferredComponent
.
uninstallDeferredComponent
(
componentName:
'testComponentName'
);
...
...
packages/flutter/test/services/haptic_feedback_test.dart
View file @
87f88734
...
...
@@ -13,6 +13,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
HapticFeedback
.
vibrate
();
...
...
@@ -27,6 +28,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
hapticFunction
();
...
...
packages/flutter/test/services/restoration_test.dart
View file @
87f88734
...
...
@@ -66,6 +66,7 @@ void main() {
final
List
<
MethodCall
>
callsToEngine
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
restoration
,
(
MethodCall
call
)
async
{
callsToEngine
.
add
(
call
);
return
null
;
});
final
RestorationManager
manager
=
RestorationManager
();
...
...
packages/flutter/test/services/system_chrome_test.dart
View file @
87f88734
...
...
@@ -14,6 +14,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
// The first call is a cache miss and will queue a microtask
...
...
@@ -71,6 +72,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemChrome
.
setPreferredOrientations
(<
DeviceOrientation
>[
...
...
@@ -89,6 +91,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemChrome
.
setApplicationSwitcherDescription
(
...
...
@@ -107,6 +110,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMessageHandler
(
'flutter/platform'
,
(
ByteData
?
message
)
async
{
log
.
add
(
message
);
return
null
;
});
await
SystemChrome
.
setApplicationSwitcherDescription
(
...
...
@@ -121,6 +125,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemChrome
.
setEnabledSystemUIOverlays
(<
SystemUiOverlay
>[
SystemUiOverlay
.
top
]);
...
...
@@ -137,6 +142,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
leanBack
);
...
...
@@ -165,6 +171,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
manual
,
overlays:
<
SystemUiOverlay
>[
SystemUiOverlay
.
top
]);
...
...
@@ -181,6 +188,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemChrome
.
setSystemUIChangeCallback
(
null
);
...
...
packages/flutter/test/services/system_navigator_test.dart
View file @
87f88734
...
...
@@ -20,6 +20,7 @@ void main() {
test
(
'System navigator control test - platform messages'
,
()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
verify
(()
=>
SystemNavigator
.
pop
(),
<
Object
>[
...
...
@@ -32,6 +33,7 @@ void main() {
test
(
'System navigator control test - navigation messages'
,
()
async
{
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
verify
(()
=>
SystemNavigator
.
selectSingleEntryHistory
(),
<
Object
>[
...
...
packages/flutter/test/services/system_sound_test.dart
View file @
87f88734
...
...
@@ -14,6 +14,7 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
!.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
SystemSound
.
play
(
SystemSoundType
.
click
);
...
...
packages/flutter/test/widgets/draggable_test.dart
View file @
87f88734
...
...
@@ -3116,6 +3116,7 @@ Future<void> _testLongPressDraggableHapticFeedback({ required WidgetTester teste
if
(
methodCall
.
method
==
'HapticFeedback.vibrate'
)
{
hapticFeedbackCalls
++;
}
return
null
;
});
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
87f88734
...
...
@@ -2207,6 +2207,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
showKeyboard
(
find
.
byType
(
EditableText
));
...
...
@@ -3502,6 +3503,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller
=
TextEditingController
();
...
...
@@ -3531,6 +3533,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller
=
TextEditingController
();
...
...
@@ -3566,6 +3569,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller1
=
TextEditingController
();
...
...
@@ -3651,6 +3655,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
const
Offset
offset
=
Offset
(
10.0
,
20.0
);
...
...
@@ -3693,6 +3698,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller
=
TextEditingController
();
...
...
@@ -3780,6 +3786,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
setState
(()
{
currentTextStyle
=
textStyle2
;
...
...
@@ -4007,6 +4014,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller
=
TextEditingController
();
...
...
@@ -6706,6 +6714,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextInputFormatter
formatter
=
TextInputFormatter
.
withFunction
((
TextEditingValue
oldValue
,
TextEditingValue
newValue
)
{
if
(
newValue
.
text
==
'I will be modified by the formatter.'
)
{
...
...
@@ -6834,6 +6843,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextInputFormatter
formatter
=
TextInputFormatter
.
withFunction
((
TextEditingValue
oldValue
,
TextEditingValue
newValue
)
{
return
const
TextEditingValue
(
text:
'Flutter is the best!'
);
...
...
@@ -6913,6 +6923,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller
=
TextEditingController
();
...
...
@@ -7034,6 +7045,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
textInput
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
TextEditingController
controller
=
TextEditingController
();
...
...
@@ -8635,7 +8647,7 @@ void main() {
);
bool
myIntentWasCalled
=
false
;
final
CallbackAction
<
ExtendSelectionByCharacterIntent
>
overrideAction
=
CallbackAction
<
ExtendSelectionByCharacterIntent
>(
onInvoke:
(
ExtendSelectionByCharacterIntent
intent
)
{
myIntentWasCalled
=
true
;
},
onInvoke:
(
ExtendSelectionByCharacterIntent
intent
)
{
myIntentWasCalled
=
true
;
return
null
;
},
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Align
(
...
...
@@ -8690,7 +8702,7 @@ void main() {
child:
Actions
(
actions:
<
Type
,
Action
<
Intent
>>{
ExtendSelectionByCharacterIntent:
CallbackAction
<
ExtendSelectionByCharacterIntent
>(
onInvoke:
(
ExtendSelectionByCharacterIntent
intent
)
{
myIntentWasCalled
=
true
;
},
onInvoke:
(
ExtendSelectionByCharacterIntent
intent
)
{
myIntentWasCalled
=
true
;
return
null
;
},
),
},
child:
EditableText
(
...
...
packages/flutter/test/widgets/modal_barrier_test.dart
View file @
87f88734
...
...
@@ -160,8 +160,10 @@ void main() {
final
List
<
String
>
playedSystemSounds
=
<
String
>[];
try
{
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
(
MethodCall
methodCall
)
async
{
if
(
methodCall
.
method
==
'SystemSound.play'
)
if
(
methodCall
.
method
==
'SystemSound.play'
)
{
playedSystemSounds
.
add
(
methodCall
.
arguments
as
String
);
}
return
null
;
});
final
Widget
subject
=
Stack
(
...
...
packages/flutter/test/widgets/mouse_region_test.dart
View file @
87f88734
...
...
@@ -1621,6 +1621,7 @@ void main() {
addTearDown
(
gesture
.
removePointer
);
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
mouseCursor
,
(
_
)
async
{
logCursors
.
add
(
'cursor'
);
return
null
;
});
final
GlobalKey
key
=
GlobalKey
();
...
...
packages/flutter/test/widgets/route_notification_messages_test.dart
View file @
87f88734
...
...
@@ -57,6 +57,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
@@ -115,6 +116,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
Directionality
(
...
...
@@ -165,6 +167,7 @@ void main() {
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
@@ -223,6 +226,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
@@ -266,6 +270,7 @@ void main() {
final
List
<
MethodCall
>
log
=
<
MethodCall
>[];
tester
.
binding
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
navigation
,
(
MethodCall
methodCall
)
async
{
log
.
add
(
methodCall
);
return
null
;
});
final
PlatformRouteInformationProvider
provider
=
PlatformRouteInformationProvider
(
...
...
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