Error in test mode "Type "double" is not a subtype of type "int"

Custom Code

Hello all,

I receive two 'double' data points from an API representing a latitude and a longitude, and I want to convert them into a 'LatLng' data type in order to display them as a Google Maps map.

What have you tried so far?

I tried to create a custom function that converts double values into 'LatLng'. The output value is correct, but I still get an error when I launch Google Maps.

L'API reçue :


The custom functions :


LatLng? latLngBis(
  double longitude,
  double latitude,
) {
  /// MODIFY CODE ONLY BELOW THIS LINE

  // Return "LatLng" with 2 datas "double"
  return LatLng(latitude, longitude);

  /// MODIFY CODE ONLY ABOVE THIS LINE
}

And the result of custom functions :


The result :

Did you check FlutterFlow's Documentation for this topic?
Yes