I have a flutter package I am working on, and if I build it for Windows it builds and from the output I can see it's working fine. However, when I try to run the tests as tests (as opposed to building it) I always get the MissingPluginException(No implementation found for method) error. It's as though the test isn't using something that is being used by actually building the app.
Is there a fix for this? I've called TestWidgetsFlutterBinding.ensureInitialized() before running tests, but always get the same error....
Test Code (works when built):
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
final networkHealth = IwNetworkHealth();
test('returns ip address', () async {
print("WifiIP: ${await networkHealth.getWifiIp()}");
});
}
Actual called code:
Future<String?> getWifiIp() async{
var info = NetworkInfo();
var wifiIP = await info.getWifiIP();
return wifiIP;
}