Skip to content

Commit cf58301

Browse files
committed
fix analysis issue of using deprecated mock method call handler sets
1 parent ee1da8a commit cf58301

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

test/stack_wallet_backup_method_channel_test.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ void main() {
99
TestWidgetsFlutterBinding.ensureInitialized();
1010

1111
setUp(() {
12-
channel.setMockMethodCallHandler((MethodCall methodCall) async {
13-
return '42';
14-
});
12+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
13+
.setMockMethodCallHandler(
14+
channel,
15+
(methodCall) async => '42',
16+
);
1517
});
1618

1719
tearDown(() {
18-
channel.setMockMethodCallHandler(null);
20+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
21+
.setMockMethodCallHandler(
22+
channel,
23+
(methodCall) => null,
24+
);
1925
});
2026

2127
test('getPlatformVersion', () async {

0 commit comments

Comments
 (0)