File tree Expand file tree Collapse file tree 14 files changed +18
-125
lines changed
supabase-anonymous-auth/lib
supabase-edge-function-auth/lib
supabase-todolist-drift/lib
supabase-todolist-optional-sync Expand file tree Collapse file tree 14 files changed +18
-125
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,7 @@ final List<RegExp> fatalResponseCodes = [
2525];
2626
2727class DjangoConnector extends PowerSyncBackendConnector {
28- PowerSyncDatabase db;
29-
30- DjangoConnector (this .db);
28+ DjangoConnector ();
3129
3230 final ApiClient apiClient = ApiClient (AppConfig .djangoUrl);
3331
@@ -123,7 +121,7 @@ Future<void> openDatabase() async {
123121 if (await isLoggedIn ()) {
124122 // If the user is already logged in, connect immediately.
125123 // Otherwise, connect once logged in.
126- currentConnector = DjangoConnector (db );
124+ currentConnector = DjangoConnector ();
127125 db.connect (connector: currentConnector);
128126 }
129127}
Original file line number Diff line number Diff line change @@ -27,12 +27,10 @@ final List<RegExp> fatalResponseCodes = [
2727
2828/// Use Supabase for authentication and data upload.
2929class SupabaseConnector extends PowerSyncBackendConnector {
30- PowerSyncDatabase db;
31-
3230 // ignore: unused_field
3331 Future <void >? _refreshFuture;
3432
35- SupabaseConnector (this .db );
33+ SupabaseConnector ();
3634
3735 /// Get a Supabase token to authenticate against the PowerSync instance.
3836 @override
@@ -152,5 +150,5 @@ Future<void> openDatabase() async {
152150
153151 await loadSupabase ();
154152
155- db.connect (connector: SupabaseConnector (db ));
153+ db.connect (connector: SupabaseConnector ());
156154}
Original file line number Diff line number Diff line change @@ -26,12 +26,10 @@ final List<RegExp> fatalResponseCodes = [
2626
2727/// Use Supabase for authentication and data upload.
2828class SupabaseConnector extends PowerSyncBackendConnector {
29- PowerSyncDatabase db;
30-
3129 // ignore: unused_field
3230 Future <void >? _refreshFuture;
3331
34- SupabaseConnector (this .db );
32+ SupabaseConnector ();
3533
3634 /// Get a Supabase token to authenticate against the PowerSync instance.
3735 @override
@@ -160,15 +158,15 @@ Future<void> openDatabase() async {
160158 if (isLoggedIn ()) {
161159 // If the user is already logged in, connect immediately.
162160 // Otherwise, connect once logged in.
163- currentConnector = SupabaseConnector (db );
161+ currentConnector = SupabaseConnector ();
164162 db.connect (connector: currentConnector);
165163 }
166164
167165 Supabase .instance.client.auth.onAuthStateChange.listen ((data) async {
168166 final AuthChangeEvent event = data.event;
169167 if (event == AuthChangeEvent .signedIn) {
170168 // Connect to PowerSync when the user is signed in
171- currentConnector = SupabaseConnector (db );
169+ currentConnector = SupabaseConnector ();
172170 db.connect (connector: currentConnector! );
173171 } else if (event == AuthChangeEvent .signedOut) {
174172 // Implicit sign out - disconnect, but don't delete data
Original file line number Diff line number Diff line change @@ -47,14 +47,14 @@ Future<void> openDatabase() async {
4747 SupabaseConnector ? currentConnector;
4848
4949 if (isLoggedIn ()) {
50- currentConnector = SupabaseConnector (db );
50+ currentConnector = SupabaseConnector ();
5151 db.connect (connector: currentConnector);
5252 }
5353
5454 Supabase .instance.client.auth.onAuthStateChange.listen ((data) async {
5555 final AuthChangeEvent event = data.event;
5656 if (event == AuthChangeEvent .signedIn) {
57- currentConnector = SupabaseConnector (db );
57+ currentConnector = SupabaseConnector ();
5858 db.connect (connector: currentConnector! );
5959 } else if (event == AuthChangeEvent .signedOut) {
6060 currentConnector = null ;
@@ -66,8 +66,7 @@ Future<void> openDatabase() async {
6666}
6767
6868class SupabaseConnector extends PowerSyncBackendConnector {
69- PowerSyncDatabase db;
70- SupabaseConnector (this .db);
69+ SupabaseConnector ();
7170
7271 @override
7372 Future <void > uploadData (PowerSyncDatabase database) async {
Original file line number Diff line number Diff line change @@ -28,11 +28,9 @@ final List<RegExp> fatalResponseCodes = [
2828
2929/// Use Supabase for authentication and data upload.
3030class SupabaseConnector extends PowerSyncBackendConnector {
31- PowerSyncDatabase db;
32-
3331 Future <void >? _refreshFuture;
3432
35- SupabaseConnector (this .db );
33+ SupabaseConnector ();
3634
3735 /// Get a Supabase token to authenticate against the PowerSync instance.
3836 @override
@@ -172,15 +170,15 @@ Future<void> openDatabase() async {
172170 if (isLoggedIn ()) {
173171 // If the user is already logged in, connect immediately.
174172 // Otherwise, connect once logged in.
175- currentConnector = SupabaseConnector (db );
173+ currentConnector = SupabaseConnector ();
176174 db.connect (connector: currentConnector);
177175 }
178176
179177 Supabase .instance.client.auth.onAuthStateChange.listen ((data) async {
180178 final AuthChangeEvent event = data.event;
181179 if (event == AuthChangeEvent .signedIn) {
182180 // Connect to PowerSync when the user is signed in
183- currentConnector = SupabaseConnector (db );
181+ currentConnector = SupabaseConnector ();
184182 db.connect (connector: currentConnector! );
185183 } else if (event == AuthChangeEvent .signedOut) {
186184 // Implicit sign out - disconnect, but don't delete data
Original file line number Diff line number Diff line change @@ -27,11 +27,9 @@ final List<RegExp> fatalResponseCodes = [
2727
2828/// Use Supabase for authentication and data upload.
2929class SupabaseConnector extends PowerSyncBackendConnector {
30- PowerSyncDatabase db;
31-
3230 Future <void >? _refreshFuture;
3331
34- SupabaseConnector (this .db );
32+ SupabaseConnector ();
3533
3634 /// Get a Supabase token to authenticate against the PowerSync instance.
3735 @override
@@ -189,7 +187,7 @@ Future<void> connectDatabase() async {
189187 await switchToSyncedSchema (db, getUserId ());
190188 }
191189
192- currentConnector = SupabaseConnector (db );
190+ currentConnector = SupabaseConnector ();
193191 await db.connect (connector: currentConnector);
194192
195193 Supabase .instance.client.auth.onAuthStateChange.listen ((data) async {
You can’t perform that action at this time.
0 commit comments