title: How do I save new data to a JSON file in Flutter?
body: <p>I have a JSON file that looks like this:</p>
  
  <pre><code>{
    "header": [
      "[[1, 26, 242, 151]]",
      "[[1, 26, 242, 152]]"
    ],
    "[[1, 26, 242, 151]]": {
      "key": "73E5-16AC-260C-3C8C"
    },
    "[[1, 26, 242, 152]]": {
      "key": "73E5-16AC-260C-3C8D"
    }
  }
  </code></pre>
  
  <p>So now let's assume I want to add a third object to the file that looks like this:</p>
  
  <pre><code>  "[[1, 26, 242, 153]]": {
      "key": "73E5-16AC-260C-3C8E"
    }
  </code></pre>
  
  <p>How can I write that that to my JSON file while keeping the correct formatting and all, and adding the name of the object to the array of the header?</p>
  
  <p>And I want to change the <code>key</code> value of <code>"[[1, 26, 242, 151]]"</code> from <code>"73E5-16AC-260C-3C8C"</code> to <code>"84F6-27BD-361D-4D9D"</code>. </p>
  
  <p>How should I do that?</p>