<p dir="auto">The <code class="notranslate">shared_preferences</code> plugin only works for the app itself, not when running unit tests. To my mind this means that the</p>
<p dir="auto">Exception report</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="package:flutter/src/services/platform_channel.dart 278:7  MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _AsyncAwaitCompleter.completeError
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
package:shared_preferences/shared_preferences.dart 25:27  SharedPreferences.getInstance
This test failed after it had already completed. Make sure to use [expectAsync]
or the [completes] matcher when testing async code.
package:flutter/src/services/platform_channel.dart 278:7  MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _AsyncAwaitCompleter.completeError
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
package:shared_preferences/shared_preferences.dart 25:27  SharedPreferences.getInstance
MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
package:flutter/src/services/platform_channel.dart 278:7  MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _AsyncAwaitCompleter.completeError
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
package:shared_preferences/shared_preferences.dart 25:27  SharedPreferences.getInstance
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
test/model/Model_test.dart                                main.&lt;fn&gt;.&lt;fn&gt;

MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)"><pre class="notranslate"><code class="notranslate">package:flutter/src/services/platform_channel.dart 278:7  MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _AsyncAwaitCompleter.completeError
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
package:shared_preferences/shared_preferences.dart 25:27  SharedPreferences.getInstance
This test failed after it had already completed. Make sure to use [expectAsync]
or the [completes] matcher when testing async code.
package:flutter/src/services/platform_channel.dart 278:7  MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _AsyncAwaitCompleter.completeError
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
package:shared_preferences/shared_preferences.dart 25:27  SharedPreferences.getInstance
MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
package:flutter/src/services/platform_channel.dart 278:7  MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _AsyncAwaitCompleter.completeError
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
package:flutter/src/services/platform_channel.dart        MethodChannel.invokeMethod
package:shared_preferences/shared_preferences.dart 25:27  SharedPreferences.getInstance
===== asynchronous gap ===========================
dart:async                                                _asyncThenWrapperHelper
test/model/Model_test.dart                                main.&lt;fn&gt;.&lt;fn&gt;

MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
</code></pre></div>
<p dir="auto">Flutter doctor -v</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="✓] Flutter (Channel master, v0.10.3-pre.65, on Mac OS X 10.14.1 18B75, locale en-NL)
    • Flutter version 0.10.3-pre.65 at /Users/sandervanderwal/Developer/flutter
    • Framework revision 01c7081565 (7 days ago), 2018-10-31 21:12:51 -0700
    • Engine revision c79faed71c
    • Dart version 2.1.0 (build 2.1.0-dev.8.0 bf26f760b1)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    • Android SDK at /Users/sandervanderwal/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 30.0.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected device (2 available)
    • Turminder Xuss • ca4f8a0ddd55132ab42c253d7496b90a38b6b53c • ios • iOS 12.1
    • iPhone 6       • F1C23CB3-7C89-416E-87D0-5CCDC2C89254     • ios • iOS 12.1 (simulator)

• No issues found!"><pre class="notranslate"><code class="notranslate">✓] Flutter (Channel master, v0.10.3-pre.65, on Mac OS X 10.14.1 18B75, locale en-NL)
    • Flutter version 0.10.3-pre.65 at /Users/sandervanderwal/Developer/flutter
    • Framework revision 01c7081565 (7 days ago), 2018-10-31 21:12:51 -0700
    • Engine revision c79faed71c
    • Dart version 2.1.0 (build 2.1.0-dev.8.0 bf26f760b1)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    • Android SDK at /Users/sandervanderwal/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 30.0.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected device (2 available)
    • Turminder Xuss • ca4f8a0ddd55132ab42c253d7496b90a38b6b53c • ios • iOS 12.1
    • iPhone 6       • F1C23CB3-7C89-416E-87D0-5CCDC2C89254     • ios • iOS 12.1 (simulator)

• No issues found!
</code></pre></div>
<p dir="auto">-- Pod update in the iOS folder</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sanders-mbp:ios sandervanderwal$ pod update
Update all pods
Updating local specs repositories
  $ /usr/bin/git -C /Users/sandervanderwal/.cocoapods/repos/master fetch origin
  --progress
  remote: Enumerating objects: 19073, done.        
  remote: Counting objects: 100% (19073/19073), done.        
  remote: Compressing objects: 100% (346/346), done.        
  remote: Total 57973 (delta 18823), reused 18706 (delta 18706), pack-reused 38900        
  Receiving objects: 100% (57973/57973), 6.45 MiB | 8.49 MiB/s, done.
  Resolving deltas: 100% (39408/39408), completed with 4694 local objects.
  From https://github.com/CocoaPods/Specs
     1032228ce29..a21d78b8fba  master     -&gt; origin/master
  $ /usr/bin/git -C /Users/sandervanderwal/.cocoapods/repos/master rev-parse
  --abbrev-ref HEAD
  master
  $ /usr/bin/git -C /Users/sandervanderwal/.cocoapods/repos/master reset --hard
  origin/master
  Checking out files: 100% (281500/281500), done.
  HEAD is now at a21d78b8fba [Add] WXWLaunchAdvertisedAdd 0.0.1
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 5913 and retry the command.

CocoaPods 1.6.0.beta.2 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0.beta.2

Analyzing dependencies
Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
Fetching podspec for `flutter_secure_storage` from `.symlinks/plugins/flutter_secure_storage/ios`
Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
Downloading dependencies
Using Flutter (1.0.0)
Using flutter_secure_storage (3.1.1)
Using image_picker (0.0.1)
Using shared_preferences (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 4 dependencies from the Podfile and 4 total pods installed.

[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
sanders-mbp:ios sandervanderwal$ "><pre class="notranslate"><code class="notranslate">sanders-mbp:ios sandervanderwal$ pod update
Update all pods
Updating local specs repositories
  $ /usr/bin/git -C /Users/sandervanderwal/.cocoapods/repos/master fetch origin
  --progress
  remote: Enumerating objects: 19073, done.        
  remote: Counting objects: 100% (19073/19073), done.        
  remote: Compressing objects: 100% (346/346), done.        
  remote: Total 57973 (delta 18823), reused 18706 (delta 18706), pack-reused 38900        
  Receiving objects: 100% (57973/57973), 6.45 MiB | 8.49 MiB/s, done.
  Resolving deltas: 100% (39408/39408), completed with 4694 local objects.
  From https://github.com/CocoaPods/Specs
     1032228ce29..a21d78b8fba  master     -&gt; origin/master
  $ /usr/bin/git -C /Users/sandervanderwal/.cocoapods/repos/master rev-parse
  --abbrev-ref HEAD
  master
  $ /usr/bin/git -C /Users/sandervanderwal/.cocoapods/repos/master reset --hard
  origin/master
  Checking out files: 100% (281500/281500), done.
  HEAD is now at a21d78b8fba [Add] WXWLaunchAdvertisedAdd 0.0.1
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 5913 and retry the command.

CocoaPods 1.6.0.beta.2 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.6.0.beta.2

Analyzing dependencies
Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
Fetching podspec for `flutter_secure_storage` from `.symlinks/plugins/flutter_secure_storage/ios`
Fetching podspec for `image_picker` from `.symlinks/plugins/image_picker/ios`
Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
Downloading dependencies
Using Flutter (1.0.0)
Using flutter_secure_storage (3.1.1)
Using image_picker (0.0.1)
Using shared_preferences (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 4 dependencies from the Podfile and 4 total pods installed.

[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
sanders-mbp:ios sandervanderwal$ 
</code></pre></div>
<p dir="auto">What is weird is that pub spec.yaml has  shared_preferences: ^0.4.3<br>
while pod update lists using shared_preferences (0.0.1)</p>
<p dir="auto"><a href="https://flutter.io/setup-windows/#clone-the-repo" rel="nofollow">https://flutter.io/setup-windows/#clone-the-repo</a> currently recommends to add flutter to the <code class="notranslate">PATH</code> with the following command:</p>
<div class="highlight highlight-source-batchfile notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="setx PATH &quot;%PATH%;&lt;cd&gt;\flutter\bin&quot;"><pre class="notranslate"><span class="pl-k">setx</span> <span class="pl-k">PATH</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">%PATH%</span>;&lt;cd&gt;\flutter\bin<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">This is problematic because it messes up the <code class="notranslate">PATH</code> in a bad way (and the result differs depending on if the command is executed in PowerShell or CMD):</p>
<p dir="auto">In CMD, the first <code class="notranslate">PATH</code> in the command references to the <em>user</em> PATH while the second instance (<code class="notranslate">%PATH%</code>) is expanded (by CMD) to the <em>combination</em> of user and system PATH. Essentially, this means that the command copies the system PATH into the user PATH and stores system+user PATH in the user PATH variable. This leads to duplication (some values are now present in system and user path) and it is also likely that the new user path will now be larger than the max length for env variables (1024 characters). This causes the PATH to get silently truncated (bad! some values that were in the PATH will get lost!).</p>
<p dir="auto">In PowerShell it fails in a different way: The first <code class="notranslate">PATH</code> in the command still references to the <em>user</em> PATH. However, PowerShell does not expand <code class="notranslate">%PATH%</code> to anything and just writes the string <code class="notranslate">%PATH%;&lt;cd&gt;\flutter\bin</code> verbatim into the user PATH variable overwriting whatever used to be in the user PATH variable. The old values of the user path are lost!</p>
<p dir="auto">What's the solution?</p>
<p dir="auto">Unfortunately, there is no easy build-in way to append anything to the user PATH from CMD or PowerShell. Here are our options:</p>
<ul dir="auto">
<li>We could redirect users to the Windows GUI for editing the PATH variable:
<ul dir="auto">
<li>Control Panel &gt; User Accounts &gt; User Accounts &gt; Change my environment variables</li>
<li>Under "User variables" add a PATH user variable with the full path to <code class="notranslate">flutter\bin</code> as value. Or, if a variable with that name already exists, add the full path to <code class="notranslate">flutter\bin</code> to it separated by <code class="notranslate">;</code>.</li>
</ul>
</li>
<li>We could provide a script to modify the PATH variable directly in the registry. Example for CMD:
<ul dir="auto">
<li><code class="notranslate">for /f "skip=2 tokens=3*" %a in ('reg query HKCU\Environment /v PATH') do @if [%b]==[] ( @setx PATH "&lt;path to flutter\bin&gt;;%~a" ) else ( @setx PATH "&lt;path to flutter\bin&gt;;%~a %~b" )</code></li>
<li>scary command</li>
<li>only works in CMD, would have to provide alternatives for other shells (e.g. PowerShell, etc)</li>
</ul>
</li>
<li>We could ask users to modify the PATH for the current session only:
<ul dir="auto">
<li>in CMD: <code class="notranslate">set PATH=C:\src\flutter\bin;%PATH%</code></li>
<li>in PowerShell: <code class="notranslate">$env:path="C:\sdfsdf sdf\bin;$env:path"</code></li>
<li>PATH modification is not permanent, lost when current shell window is closed</li>
<li>need to provide different commands for different shells</li>
</ul>
</li>
</ul>
<p dir="auto">Given that the first option is going to be the only one that will work independent of what shell is used, I'd vote for changing the documentation to that one.</p>