Legacy integration guide for creating local-first apps with FlutterFlow and PowerSync with Supabase as the backend.
Video walkthrough of the integration guide.
postgres
user in your Supabase account for replicating changes to PowerSync, since elevating custom roles to replication has been disabled in Supabase. If you want to use a custom role for this purpose, contact the Supabase support team.Next
version of the Service, which may contain early access or experimental features. Always use the Stable
version in production.[YOUR-PASSWORD]
placeholder)
powersync_role
and password you created when configuring your Supabase for PowerSync (see Source Database Setup).
verify-full
SSL mode without additional configuration.
sync-rules.yaml
file.
sync-rules.yaml
file’s contents with the below:PowerSyncUrl
.Click on Test
initpowersync
.
Schema
, Column
and Table
with powersync
.powersync: ^1.8.4
sqflite: ^2.3.3
main.dart
and set your new Custom Action as a Final Action and click Save.watchLists
and paste the below code:getLists
and paste the following code into it:watchLists
Custom Action.callback
Argument for watchLists
.getLists
Custom Action and set the results
Action Argument to result
and click “Confirm”:allLists
and you should now see this:boundLists
and set its value to allLists
(no further changes). Click Save.name
field from the boundLists
variable:created_at
.lists
table is empty in Supabase. Create a test row in the table by clicking on “Insert” -> “Insert Row” in your Supabase Table Editor.id
and created_at
blank.owner_id
and select your test user.createListItem
and paste the following code:name
of type String and not nullable.fabClicked
and set the type to boolean and toggle the “Initial Field Value” toggle twice to initialize the field to false.fabClicked
value to true
and click Close.fabClicked
.createListItem
.fabClicked
to false.deleteListItem
and paste the below code:boundLists
to deleteListItem
as follows:updateListItem
and paste the below code:editClicked
, set the type to Boolean and toggle the “Initial Field Value” toggle twice to initialize the field to false.listItemIndex
, set the type to Integer. Click Confirm.editClicked
value to true
.listItemIndex
to the “Index in List” of the boundLists
Item and click Close.editClicked
.updateListItem
.listItemIndex
Page State variableeditClicked
to false.listItemIndex
to Reset Value.signOut
without Arguments or Return Values and paste the below code:signOut
Custom Action.owner_id
matches their user id:
sync-rules.yaml
file.watch()
queries creates a StreamSubscription and it’s important to regularly call .cancel()
on these to avoid multiple subscriptions for the same query running.Podfile
located in the ios/
directoryPodfile
needs to be updated from use_frameworks! :linkage => :static
to use_frameworks!
(remove everything after the exclamation sign)