VS Code says that .execute isn't defined for the type 'PostgrestFilterBuilder'.
Here is my Code:
text_service.dart
import 'package:thrive/main.dart';
class TextService {
Future<List<String>> fetchTexts() async {
final response = await supabase
.from('profiles')
.select('community')
.execute();
if (response.error != null) {
throw response.error!;
}
final data = response.data as List<dynamic>;
return data.map((item) => item['community'] as String).toList();
}
}
I tried to use .get instead of .execute but this also doesn't work. Can someone help me?