title: Get Map<String, dynamic> from Map<dynamic, dynamic> flutter
body: <p>I have the code below :</p>
  <pre><code> Map&lt;dynamic, dynamic&gt; result = snapshot.value;
   Map&lt;String, dynamic&gt; data = Map&lt;String, dynamic&gt;();
   for (dynamic type in result.keys) {
      data[type.toString()] = result[type];
   }
   print(data);
   print(data.runtimeType);
  
  </code></pre>
  <p>but data type is <code>_InternalLinkedHashMap&lt;String, dynamic&gt;</code> and i am not able to read its value, despite the ugly hack i have done above.</p>
  <p>The direct cast also doesn't work : <code>snapshot.value as Map&lt;String, dynamic&gt;</code> throws the error : <code>'_InternalLinkedHashMap&lt;Object?, Object?&gt;' is not a subtype of type 'Map&lt;String, dynamic&gt;'</code></p>
  <p>I need to have a Map&lt;String, dynamic&gt; type to be able to create my custom class Object.</p>
  <p><code>snapshot.value</code> has a type of dynamic, but it's a json object that returns the result of a Realtime Database query and there is no documentation about how to retrieve the value into a Flutter object.</p>
  <p>I have tried this <a href="https://stackoverflow.com/questions/55430061/unhandled-exception-internallinkedhashmapstring-dynamic-is-not-a-subtype-of">answer</a> but i can't use it as <code>jsonDecode()</code> takes a String as a parameter.</p>