title: How to look up values in a large JSON file in Dart
body: <p>I have a large JSON file with many objects with many properties. Simplified structure looks like this:</p>
  
  <pre><code>"allGadgets": [
        {
          "Model Code": "nokia1",
          "Top Category": "Mobile Phones",
          "Category": "non-iPhone",
          "Brand": "Nokia",
          "Device": "1",
  
          "Price": "£ 11"
        },
        {
          "Model Code": "nokia2",
          "Top Category": "Mobile Phones",
          "Category": "non-iPhone",
          "Brand": "Nokia",
          "Device": "2",
  
          "Price": "£ 17",
        },
        {
          "Model Code": "nokia3",
          "Top Category": "Mobile Phones",
          "Category": "non-iPhone",
          "Brand": "Nokia",
          "Device": "3",
  
          "Price": "£ 10",
  
        }] ... plus a few hundreds more of different brands and models
  </code></pre>
  
  <p>I'm extracting from this json list of maps a list of Strings for a search panel for the user to look up their device. The Strings are made of two of the values from the json, i.e.: <code>"${item['Brand']} - ${item['Device']}"</code></p>
  
  <p>Once the user has selected the relevant model from the dropdown search panel, I need to use this string value to give them the price from the json file. The question is how do I achieve that in dart/flutter? If it was html/css, I would have added an extra hidden field of model code and/or price itself and then just made it visible. </p>
  
  <p>In flutter/dart, however, a search panel plugin I found only accepts Strings, which the user selects and which then have to be used to look up the the corresponding price value in the json file. </p>
  
  <p>Complicating the lookup is the fact that my Strings are now composed of two field values with spaces and a hyphen in between so I probably need to convert them back into how they had been prior to the string conversion and then use both for the lookup... which sounds quite convoluted...</p>
  
  <p>Any thoughts on how to solve the above task would be welcome! </p>
  
  <p>What I guess would help a lot is an example - looking up an object using a String (formed from two values from the objects) within a json with many objects. User is presented with a subset of those objects, but just sees a couple of fields from them. Then the user effectively selects a query using the String shown to him based off the two fields. That String then allows to look up the object and find another value (price) in that corresponding object...</p>