I have a test project a Supabase website with these 2 tables :
and this is my main file :
import 'package:flutter/material.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Supabase.initialize(
url: 'https://fszmicgacuftwaxzrydi.supabase.co',
anonKey:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZzem1pY2dhY3VmdHdheHpyeWRpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTQ4MDY0MzIsImV4cCI6MjAzMDM4MjQzMn0.BhjbhjnuuIcFDZwtUF7FWehbna7KSrChm_s7UAJpRLdukvtko',
);
runApp(MyApp());
}
final supabase = Supabase.instance.client;
class MyApp extends StatelessWidget {
MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Supabase Places Test')),
body: Center(
child: ElevatedButton(
onPressed: () async {
final data = await supabase.from('places').select();
print(data);
},
child: const Text('Fetch Data'),
),
),
),
);
}
}
key and url are correct , but i cant get the data , is there any problem here?
2
Answers
I had to disabled the RLS security of the table
Please Disable RLS Security of Supabase To Fetch All Data. I Hope this comment will Helpful.