Closed trillom closed 5 years ago
Flutter plugins (including flutter_sodium) don't work in unit tests. Tests run completely headless, in a dart only environment. There's no Android or iOS runtime available.
You can mock a plugin, see https://docs.flutter.io/flutter/services/MethodChannel/setMockMethodCallHandler.html
I'm receiving the following error:
MissingPluginException(No implementation found for method crypto_box_keypair on channel flutter_sodium)
I've tried reloads, restarts, starting a new project with JUST the offending code, deleting generated files and rebuilding, nothing works. Code below.
Example class:
Unit test:
Full output: