title: Unhandled Exception: type 'String' is not a subtype of type 'double' even if a double is given
body: <p>I'm fetching coordinates from Firestore to fill my map with stores locations. The Google Map Marker needs a LatLng object (that takes two <code>double</code> as parameters) with the latitude and longitude of a point. But, for each increment, I get the following exception: <code>type 'String' is not a subtype of type 'double'</code> (verbose down below).</p>
  
  <p>However, the points do appear on the map, which should mean that the values ARE of type double...</p>
  
  <p>I used the following code to identify the latitude and longitude type:</p>
  
  <pre class="lang-dart prettyprint-override"><code>if (store['latitude'] is double) {
    print('double!');
  } else if (store['latitude'] is String) {
    print('string!');
  }
  print('');
  if (store['longitude'] is double) {
    print('double!');
  } else if (store['longitude'] is String) {
    print('string!');
  }
  print('');
  </code></pre>
  
  <p>It says "double!" each time.</p>
  
  <p>Here is the code:</p>
  
  <pre class="lang-dart prettyprint-override"><code>Firestore.instance
          .collection('points-of-sale')
          .snapshots()
          .listen((data) =&gt; data.documents.forEach((store) {
                LatLng pos = LatLng(
                   store['latitude'], // Here
                   store['longitude'] // and here
                );
                /* Adding a marker to the map */
              }));
  </code></pre>
  
  <p>This is the full error:</p>
  
  <pre><code>[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: type 'String' is not a subtype of type 'double'
  #0      _StoreLocatorState._addMarker (package:leonor_greyl_app_2019_41820/pages/StoreLocatorWidget.dart:21:30)
  #1      _StoreLocatorState.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:leonor_greyl_app_2019_41820/pages/StoreLocatorWidget.dart:48:15)
  #2      List.forEach (dart:core-patch/growable_array.dart:278:8)
  #3      _StoreLocatorState.build.&lt;anonymous closure&gt; (package:leonor_greyl_app_2019_41820/pages/StoreLocatorWidget.dart:47:42)
  #4      _rootRunUnary (dart:async/zone.dart:1132:38)
  #5      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
  #6      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
  #7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
  #8      _DelayedData.perform (dart:async/stream_impl.dart:591:14)
  #9      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
  #10     _PendingEvents.schedule.&lt;anonymous closure&gt; (dart:a&lt;…&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong>
  This is the full verbose output for <code>parseDouble(store['latitude'])</code>:</p>
  
  <pre><code>[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: FormatException: Invalid double
  x
  #0      double.parse (dart:core-patch/double_patch.dart:110:28)
  #1      _StoreLocatorState._addMarker (package:leonor_greyl_app_2019_41820/pages/StoreLocatorWidget.dart:22:66)
  #2      _StoreLocatorState.build.&lt;anonymous closure&gt;.&lt;anonymous closure&gt; (package:leonor_greyl_app_2019_41820/pages/StoreLocatorWidget.dart:51:15)
  #3      List.forEach (dart:core-patch/growable_array.dart:278:8)
  #4      _StoreLocatorState.build.&lt;anonymous closure&gt; (package:leonor_greyl_app_2019_41820/pages/StoreLocatorWidget.dart:50:42)
  #5      _rootRunUnary (dart:async/zone.dart:1132:38)
  #6      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
  #7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
  #8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
  #9      _DelayedData.perform (dart:async/stream_impl.dart:591:14)
  #10     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
  #11     _&lt;…&gt;
  </code></pre>