Building offline-first mobile apps with Supabase, Flutter and Brick

Table of Contents
Why Offline?
Building offline-first mobile apps provides the best user experience when steady bandwidth cannot be guaranteed. Brick's local cache ensures quicker round trip times by storing all data from Supabase locally. This reduces the time and expense of round trips, and even offers a third cache in memory for improved performance. Requests made while offline are retried until the app reconnects online, ensuring local state syncs with remote state.
Getting Started
- Create a Flutter app.
- Add Brick dependencies to your dependencies.
- Set up directories for Brick's generated code.
- Define models in Dart that match Supabase table columns.
- Generate code for adapters and migrations.
- Check and review generated migrations for accuracy.
- Re-run adapter generation after every model change.
- Interact with Brick's entrypoint to handle data fetching and caching seamlessly.
- Run your app.