title: How to read local json import in flutter?
body: <p>I have a JSON file in the flutter directory, not in assets.</p>
  <p>json_data.json:-</p>
  <pre><code> {
      &quot;foo&quot; : &quot;bar&quot;
   }
  </code></pre>
  <p>I want to read this JSON on different files.</p>
  <p>like</p>
  <p>myfile.dart:-</p>
  <pre><code> import &quot;package:mypackage/json_data.json&quot; as data;
   import 'dart:convert';
   
    var my_data = json.decode(data);
  </code></pre>
  <p>I am getting the error:-</p>
  <pre><code>The name 'data' refers to an import prefix, so it must be followed by '.'.
  Try correcting the name to refer to something other than a prefix, or renaming the prefix.
  </code></pre>
  <p>What is the problem here? why can't I read JSON from local import in flutter?</p>