How to load JSON assets into Flutter App : <p>How do I load a JSON asset into my Flutter app?</p>

<p>My <code>pubspec.yaml</code> file has the following:</p>

<pre><code>  assets:
    - assets/data.json
</code></pre>

<p>I keep getting stuck trying to load the data. I tried </p>

<pre><code>final json = JSON.decode(
    DefaultAssetBundle.of(context).loadString("assets/data.json")
);
</code></pre>

<p>But I get the error</p>

<blockquote>
  <p>The argument type 'Future&lt; String>' can't be assigned to the parameter type 'String'.</p>
</blockquote>

<p>Thanks!</p>
