In Dart/Flutter, using the supabase package, I’m trying to decode the data I receive for example from the following code:
final data = await supabase
.from('countries')
.select('''
name,
cities (
name
)
''');
How do I do that? Can anyone provide me with an example how I get the resulting Dart objects out of data? How would I e.g. print the table that I get as result?
Code taken from the documentation: https://supabase.com/docs/reference/dart/select
I tried to decode it as if I would decode json but it did not work.
2
Answers
I solved it as follows (see notes below):
Please note:
Here is little code that explain how to use supabase data
See Use Supabase with Flutter for details.
For fetching data without future builder.
Method 2.