I'm unable to get Supabase queries working with flutter. Here is an example of the code:
child: FutureBuilder<PostgrestResponse<dynamic>>(
future: supabase.from('products').select().execute(),
builder: (context, snapshot) {
if (snapshot.connectionState != ConnectionState.active) {
return const Center(
child: SizedBox(
child: CircularProgressIndicator(),
width: 60,
height: 60,
),
);
} else {
return GridView.builder(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: gridColumns,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
),
itemCount: snapshot.data!.length, // this line is causing an error
...
I have no idea how to turn the length of the snapshot. It is was to turn this to streambuilder it would work. So really all i'm after is a basic example of using a futurebuilder with supabase.