Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add file
  • Loading branch information
nilsreichardt committed Sep 19, 2023
commit 91cb3f09a3e81b375d9e3116e9863a95292deebe
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class MethodChannelMock {
this.delay,
required this.methods,
}) : methodChannel = MethodChannel(channelName) {
_ambiguate(TestDefaultBinaryMessengerBinding.instance)!
.defaultBinaryMessenger
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(methodChannel, _handler);
}

Expand All @@ -39,9 +38,3 @@ class MethodChannelMock {
});
}
}

/// This allows a value of type T or T? to be treated as a value of type T?.
///
/// We use this so that APIs that have become non-nullable can still be used
/// with `!` and `?` on the stable branch.
T? _ambiguate<T>(T? value) => value;