title: How to save and retrieve a List<Map> with Get Storage
body: <p>I am trying to persist a simple <code>List&lt;Map&lt;String,dynamic&gt;&gt;</code> with GetStorage.</p>
  <p>The documentation says:</p>
  <blockquote>
  <p>When to use GetStorage:</p>
  <ul>
  <li>simple Maps storage.</li>
  <li>cache of http requests</li>
  <li>storage of simple user information.</li>
  <li>simple and persistent state</li>
  <li>storage any situation you currently use sharedPreferences.</li>
  </ul>
  </blockquote>
  <p>So, I did not encoded/decoded to json String.</p>
  <p>In the end, getting error</p>
  <pre><code>type 'List&lt;dynamic&gt;' is not a subtype of type 'List&lt;Map&lt;String, dynamic&gt;&gt;?' in type cast
  </code></pre>
  <p>Here is my code, and error is thrown at <code>box.read()</code> method:</p>
  <pre><code>  final box = GetStorage();
    var payments = &lt;Payment&gt;[].obs;
  
    Future&lt;void&gt; savePaymentsToDB() async {
      var paymentsAsMap = payments.map((payment) =&gt; payment.toJson()).toList();
      await box.write('payments', paymentsAsMap);
    }
  
    void getPaymentsFromDB() {
      var result = box.read&lt;List&lt;Map&lt;String, dynamic&gt;&gt;&gt;('payments');
      
      if (result != null) {
        payments =
            result.map((payment) =&gt; Payment.fromJson(payment)).toList().obs;
      }
    }
  </code></pre>