Using a custom Data Type to work around FlutterFlow's LatLng data type

Resolved

I'm building a custom widget to display a dynamic map within my app. The package I'm using is the flutter_map package from pub.dev. This package requires the 'latlong2' library as a pubspec dependency.

When I go to set up the parameters for the widget, I only have the datatype options that FlutterFlow provides. One of which is LatLng, but this won't work as it conflicts with the 'LatLng2' definition of 'LatLng'.

This is the error I'm getting:
The argument type 'LatLng (where LatLng is defined in /tmp/code_analysis/gSPxhKMtpobs5zwg9Be2/custom_code_project/lib/flutter_flow/lat_lng.dart)' can't be assigned to the parameter type 'LatLng (where LatLng is defined in /root/.pub-cache/hosted/pub.dev/latlong2-0.8.2/lib/latlong/LatLng.dart)'.


My question: Is it possible to create a work around where I use a Custom Data Type that conforms to the LatLng2 definition of LatLng class? My thinking is that this would allow me to circumvent this issue and continue using the flutter_map package to build this widget.

1
3 replies