title: Is this Flutter (Dart) code robust re "async" usage or are futher null checks required?
body: <p>Is the following Flutter (using Flame package too) code robust in the sense that, is there a risk &quot;prefs&quot; may not be available during &quot;update&quot; and further checks and balances should be put in?   Suggested code change to make it robust?</p>
  <pre><code>import 'dart:ui';
  import 'package:flame/components.dart';
  import 'package:flame/flame.dart';
  import 'package:shared_preferences/shared_preferences.dart';
  
  class LightComponent extends SpriteComponent  {
      SharedPreferences prefs;
      
      LightComponent() : super.fromImage(Vector2(404/4,406/4), Flame.images.fromCache('jupiter_404×406.png'),)
        
      Future&lt;void&gt; onLoad() async {
          prefs = await SharedPreferences.getInstance();
      }
      
      void render(Canvas c) {
          super.render(c);
      }
      
      void update(double t) {
          super.update(t);
          bool showWindow = prefs.getBool('showWindow');  // &lt;== IS THIS OK, OR IS THERE Pref == null potential issue to cover???
          // etc 
      }
  }
  </code></pre>