title: How to fix async/await error in flutter test?
body: <p>I'm trying to write a test for my flutter App. The function for which I am writing the test returns a Future, therefore I am using await.</p>
  
  <p>But as soon as any await statement is used I get the MissingPluginException Error.</p>
  
  <p>I tried changing dependency version, but it doesn't help. Could not find anything on GitHub for Flutter Issues or StackOverFlow regarding this.</p>
  
  <h2>check_app_version_test.dart</h2>
  
  <pre><code>import 'package:flutter_test/flutter_test.dart';
  
  import '../home.dart';
  
  void main() {
    test('checkAppVersion', () async {
      expect(await checkAppVersionTest(true), true);
    });
  }
  </code></pre>
  
  <h2>home.dart</h2>
  
  <pre><code>String currentVersionString = await GetVersion.projectVersion;
  Version currentVersion = Version.parse(currentVersionString);
  
  Future&lt;bool&gt; checkAppVersionTest([bool test, Version latestVersion]) async {
  
  ...
    if (currentVersion &lt; latestVersion) {
      updateRequired = true;
    }
  ...
  return updateRequired
  
  }
  </code></pre>
  
  <p>expected to work fine.</p>
  
  <p>Getting error:</p>
  
  <blockquote>
    <p>MissingPluginException(No implementation found for method getAll on
    channel plugins.flutter.io/package_info)<br>
    package:flutter/src/services/platform_channel.dart 300:7 
    MethodChannel.invokeMethod   ===== asynchronous gap
    ===========================   dart:async                                                _AsyncAwaitCompleter.completeError   package:flutter/src/services/platform_channel.dart<br>
    MethodChannel.invokeMethod   ===== asynchronous gap
    ===========================   dart:async                                                _asyncThenWrapperHelper   package:flutter/src/services/platform_channel.dart<br>
    MethodChannel.invokeMethod   package:package_info/package_info.dart
    38:17              PackageInfo.fromPlatform</p>
  </blockquote>