Provide a way to define a custom TestWidgetsFlutterBinding that overrides the defaultBinaryMessenger #104156
Labels
a: tests
"flutter test", flutter_test, or one of our tests
c: proposal
A detailed proposal for a change to Flutter
framework
flutter/packages/flutter repository. See also f: labels.
P3
Issues that are less important to the Flutter project
team-framework
Owned by Framework team
triaged-framework
Triaged by Framework team
Use case
In my case, I override the
defaultBinaryMessenger
just likeTestDefaultBinaryMessengerBinding
is doing:When I want to test
BinaryMessengerBinding
intestWidget()
, there is no proper way to define a customTestWidgetsFlutterBinding
(test framework needs), because the definition ofTestWidgetsFlutterBinding
mixed withTestDefaultBinaryMessengerBinding
which needs the subclass/mixin also do the same thing (I guess, but am not sure) like:Proposal
So, is there any way to test
BinaryMessengerBinding
above?If not, could please provide a way to define a custom
TestWidgetsFlutterBinding
that overrides thedefaultBinaryMessenger
but will not break the test behavior.The text was updated successfully, but these errors were encountered: