---
title: "Building offline-first mobile apps with Supabase, Flutter and Brick"
description: "Brick is a Flutter data manager that keeps Supabase data in local SQLite and optional in-memory caches so apps behave the same with or without connectivity."
url: "https://swe.quest/articles/building-offline-first-mobile-apps-with-supabase-flutter-and-brick-2c96e1b595fc5e17"
canonical: "https://supabase.com/blog/offline-first-flutter-apps"
source: "Supabase"
published: "2024-10-08"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["local-first","mobile","caching","sqlite"]
---

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

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-10-08, 6 min read, How-to. Original: [https://supabase.com/blog/offline-first-flutter-apps](https://supabase.com/blog/offline-first-flutter-apps)

## Summary

Brick is a Flutter data manager that keeps Supabase data in local SQLite and optional in-memory caches so apps behave the same with or without connectivity. Requests made offline are queued and retried until the device reconnects, and caching can be skipped per request for sensitive or must-be-fresh data. Setup walks through annotated Dart models with client-generated UUID keys (never auto-increment, so distributed clients avoid collisions) and build\_runner code generation that produces adapters and SQLite migrations, which should still be reviewed. A single repository handles queries and upserts, and the guide also covers local reactive streams (not yet wired to Supabase realtime), associations, and a mock Supabase server for unit tests.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Local-first & sync](https://swe.quest/tags/local-first.md) (Architecture & design)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)

## Prerequisites

- Flutter and Dart basics
- Supabase basics
- SQLite basics ([easy posts on SQLite](https://swe.quest/tags/sqlite.md?difficulty=easy))

## Keywords

Brick, Supabase, Flutter, SQLite, sqflite, build\_runner

## Related posts

- [Offline-first React Native Apps with Expo, WatermelonDB, and Supabase](https://swe.quest/articles/offline-first-react-native-apps-with-expo-watermelondb-and-supabase-1f52e6fbab692dbe.md): Supabase · 2023-10-08 · Medium · 7 min read · Local-first & sync, Mobile, PostgreSQL, React
  An offline-first React Native/Expo app can use WatermelonDB (SQLite-based, last-write-wins sync) as its local store and sync to Supabase Postgres through two RPC calls: a \`push\` function that applies client changesets and a \`pull\` function that returns all changes since the last sync timestamp.
- [Mobile app prototyping with Quasar and SQLite](https://swe.quest/articles/mobile-app-prototyping-with-quasar-and-sqlite-9c2497ace27025c4.md): Turso · 2024-01-05 · Medium · 8 min read · SQLite, Mobile, Frontend, JavaScript
  A recipe-book mobile prototype built with the Vue-based Quasar framework, backed by a local SQLite file accessed through a small Express server using the libSQL JavaScript client.
- [Supabase Flutter SDK 1.0 Developer Preview](https://swe.quest/articles/supabase-flutter-sdk-1-0-developer-preview-9e19816587705422.md): Supabase · 2022-08-02 · Medium · 5 min read · Mobile, Identity & auth, API design
  Supabase Flutter SDK 1.0 enters developer preview with a focus on developer experience.
- [Flutter Tutorial: building a Flutter chat app](https://swe.quest/articles/flutter-tutorial-building-a-flutter-chat-app-942d133b45bb7fa6.md): Supabase · 2022-06-30 · Medium · 19 min read · Mobile, Real-time systems, PostgreSQL, Communications
  A real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase\_flutter SDK instead of a custom API.
- [Building Local-First Apps: The Complete Guide to Offline-First Database Sync](https://swe.quest/articles/building-local-first-apps-the-complete-guide-to-offline-first-database-sync-047687e423c4421f.md): Turso · 2026-07-27 · Medium · 9 min read · Local-first & sync, SQLite, Replication, Consistency models, TypeScript
  Turso Sync brings local-first behaviour to SQLite-based apps.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
