Open GowthamanRavichandran3 opened 1 year ago
Questions like this are best asked on a user forum like StackOverflow or the Flutter Discord server. They have more eyes than just the maintainers to look.
class TestBlocMock extends Mock implements ResizeBloc {}
This is a problem (it might be the problem you are facing, but can't tell for sure, there might be others as well). I don't really know what this ResizeBloc
is, but unless it has a very specific API (all methods taking all nullable arguments and returning a nullable result), this way of using Mockito won't work in Dart >= 2.12. You have to use the code generator instead.
@srawlins @natebosch Should we update the docs and scrap all the examples without using codegen?
Should we update the docs and scrap all the examples without using codegen?
Yes.
I utilized Container and Text widgets in Flutter to create a basic example, and also incorporated a test case for my sample. However, during the test run(widget test case), I encountered a null exception as the bloc was not initialized. I have included my sample for your convenience. Is there a solution to address this issue?
Main.dart file
Test case