I'm working on a Flutterflow project where I need to save data from a PlacePicker into a Supabase table. Specifically, I'm struggling with how to properly store the LatLng data retrieved from the PlacePicker in my Supabase table. The data returned by the PlacePicker looks like this: LatLng(lat: 49.00, lng: 4.30)
.
I've tried various approaches and data types for the column in my Supabase table, but I keep encountering errors. Can someone provide guidance on the best way to handle and store this LatLng data in my Supabase table?
Any help or suggestions would be greatly appreciated. Thank you!
I've made several attempts to store the LatLng data from the PlacePicker into my Supabase table, but unfortunately, none of them have been successful. Here are the approaches I've experimented with:
JSON Formats: I attempted to use various JSON formats for the column in my Supabase table to accommodate the LatLng data. However, each attempt resulted in errors. For instance, when using a straightforward JSON representation like "{"lat": 51.6978162, "lng": 5.3036748}", I encountered errors such as PostgrestException(message: malformed record literal: "LatLng(lat: 51.6978162, lng: 5.3036748)", code: 22P02, details: Missing left parenthesis., hint: null)
.
Geometry Formats: Additionally, I experimented with different geometry formats, assuming that a geometry type might be suitable for storing geographical coordinates. Despite trying various representations, including WKT (Well-Known Text) formats, I consistently encountered errors. For example, one error message I received was PostgrestException(message: parse error - invalid geometry, code: XX000, details: , hint: "La" <-- parse error at position 2 within geometry)
.
Despite these efforts, I have yet to find a solution that allows me to successfully store the LatLng data from the PlacePicker into my Supabase table. Any further insights or suggestions on how to tackle this issue would be highly appreciated.
Thank you for your assistance.