<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rebuzz</title>
    <description>The latest articles on DEV Community by Rebuzz (@rebuzzpos).</description>
    <link>https://dev.to/rebuzzpos</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4266286%2Fb7339f00-aca1-49d9-9434-a7fc8f763f2b.png</url>
      <title>DEV Community: Rebuzz</title>
      <link>https://dev.to/rebuzzpos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rebuzzpos"/>
    <language>en</language>
    <item>
      <title>Building a 100% offline POS in Flutter: no network code, no INTERNET permission</title>
      <dc:creator>Rebuzz</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:52:08 +0000</pubDate>
      <link>https://dev.to/rebuzzpos/building-a-100-offline-pos-in-flutter-no-network-code-no-internet-permission-34f</link>
      <guid>https://dev.to/rebuzzpos/building-a-100-offline-pos-in-flutter-no-network-code-no-internet-permission-34f</guid>
      <description>&lt;p&gt;I maintain &lt;a href="https://github.com/onepiece92/openPOS" rel="noopener noreferrer"&gt;openPOS&lt;/a&gt;, an open-source point-of-sale app written in Flutter. It is built for a single shop, a single device and a single person at the counter. The one rule I will not bend is that the app's own code makes no network calls. This post covers how that rule is enforced in the repo, and what it costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why offline-first is a constraint, not a feature
&lt;/h2&gt;

&lt;p&gt;Most POS apps start as a cloud product and add an "offline mode" later. That leaves you with sync queues, conflict resolution, auth tokens and a backend someone has to pay for and keep running. A small shop pays for all of that in monthly fees and in dependence on a vendor staying in business.&lt;/p&gt;

&lt;p&gt;I went the other way. If the app has no network code, a whole class of problems is gone:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No account, no login, no server to go down.&lt;/li&gt;
&lt;li&gt;The app never sends your data anywhere. (The phone's own backup, Google or iCloud if it is on, may still include app data; more on that below.)&lt;/li&gt;
&lt;li&gt;No SDK is quietly phoning home on the shop's behalf.&lt;/li&gt;
&lt;li&gt;The app behaves the same in a farmers market with no signal as it does on office wifi.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key word is "constraint". A preference gets eroded one convenient package at a time. A rule written into the repo, and backed by the Android release manifest, is harder to erode. The project's &lt;code&gt;CLAUDE.md&lt;/code&gt; states it flatly: never add outbound network calls, never add packages that fetch resources at runtime, never re-introduce the deleted sync scaffolding (outbox queue, sync service, connectivity provider, cloud backup). Anyone, human or tool, who opens a pull request is working against that file.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the build blocks the network
&lt;/h2&gt;

&lt;p&gt;Policy is easy to write and easy to forget, so the stronger guarantee is in the Android manifest.&lt;/p&gt;

&lt;p&gt;The release build strips the &lt;code&gt;INTERNET&lt;/code&gt; permission. The relevant file is &lt;code&gt;android/app/src/release/AndroidManifest.xml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;manifest&lt;/span&gt; &lt;span class="na"&gt;xmlns:android&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"http://schemas.android.com/apk/res/android"&lt;/span&gt;
    &lt;span class="na"&gt;xmlns:tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"http://schemas.android.com/tools"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;uses-permission&lt;/span&gt; &lt;span class="na"&gt;android:name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"android.permission.INTERNET"&lt;/span&gt;
        &lt;span class="na"&gt;tools:node&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"remove"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;uses-permission&lt;/span&gt; &lt;span class="na"&gt;android:name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"android.permission.ACCESS_NETWORK_STATE"&lt;/span&gt;
        &lt;span class="na"&gt;tools:node&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"remove"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why is &lt;code&gt;remove&lt;/code&gt; needed at all, if the main manifest never asks for it? Because permissions merge in from dependencies. The Star printer SDK ships &lt;code&gt;INTERNET&lt;/code&gt; and &lt;code&gt;ACCESS_NETWORK_STATE&lt;/code&gt; in its own manifest, since it also supports LAN printers. The app only uses Bluetooth, so the release manifest strips them back out during manifest merging. Debug builds keep &lt;code&gt;INTERNET&lt;/code&gt;, because the Flutter tool needs it for hot reload.&lt;/p&gt;

&lt;p&gt;An Android app without &lt;code&gt;INTERNET&lt;/code&gt; cannot open sockets, so even if some dependency tried to reach out, the OS would refuse it. This proof is Android-only: there is no equivalent OS-level network block on iOS, where the guarantee rests on the code and the dependency list.&lt;/p&gt;

&lt;p&gt;One honest note on timing: this applies &lt;strong&gt;from the next Android release (1.1.0, not yet shipped)&lt;/strong&gt;. The build currently on Google Play still declares the permission. I would rather tell you that than overstate it. Once 1.1.0 ships, the Play listing's permission list should show no network access, and you can verify it yourself with &lt;code&gt;aapt dump permissions&lt;/code&gt; on the APK.&lt;/p&gt;

&lt;p&gt;The same idea exists on the desktop side of the codebase. &lt;code&gt;macos/Runner/Release.entitlements&lt;/code&gt; contains only two entries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;com.apple.security.app-sandbox&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;com.apple.security.files.user-selected.read-write&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The App Sandbox is on, and there is no &lt;code&gt;com.apple.security.network.client&lt;/code&gt; or &lt;code&gt;.server&lt;/code&gt; entitlement, so a sandboxed release binary cannot reach the network. I mention this as a codebase detail only. macOS is not a shipped product.&lt;/p&gt;

&lt;p&gt;From 1.1.0, the main manifest also sets &lt;code&gt;allowBackup="false"&lt;/code&gt;, &lt;code&gt;fullBackupContent="false"&lt;/code&gt; and a data-extraction rules file. The reason is the same as the rest of this post: the database should not be silently copied to a Google account or another device by the OS. Backup is something the owner does on purpose. Until that release ships, the phone's own backup may include app data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The banned packages, and why
&lt;/h2&gt;

&lt;p&gt;The list of things the repo refuses is short and specific:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;google_fonts&lt;/code&gt;&lt;/strong&gt;. It downloads font files at runtime. Instead the app bundles JetBrains Mono under &lt;code&gt;assets/fonts/&lt;/code&gt; and uses it by name:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;  &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;_fontFamily&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'JetBrainsMono'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fonts are declared in &lt;code&gt;pubspec.yaml&lt;/code&gt; and ship inside the binary. The first launch looks the same as the hundredth, with or without a connection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;connectivity_plus&lt;/code&gt;&lt;/strong&gt;. There is nothing to branch on. The app is never "online", so it never needs to ask. Code that checks connectivity is also code that eventually does something different when connected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;workmanager&lt;/code&gt; for sync&lt;/strong&gt;. No background sync, so no background worker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firebase, Supabase and similar clients&lt;/strong&gt;. These are the obvious ones. They also bring analytics and crash reporting along, which are banned for the same reason.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analytics, telemetry, crash reporting, remote config, update checkers&lt;/strong&gt;. None of them are in the app.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can audit this from &lt;code&gt;pubspec.yaml&lt;/code&gt; in a minute. The dependency list is Riverpod, Drift and SQLite, Hive, go_router, ESC/POS printing packages, &lt;code&gt;pdf&lt;/code&gt;/&lt;code&gt;printing&lt;/code&gt;, &lt;code&gt;image_picker&lt;/code&gt;, &lt;code&gt;share_plus&lt;/code&gt;, &lt;code&gt;csv&lt;/code&gt;, &lt;code&gt;url_launcher&lt;/code&gt;, and a handful of utilities. &lt;code&gt;archive&lt;/code&gt; is there for zip snapshots and is pure Dart. A dependency list that short is easy to review, and that is part of the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  The database: Drift on SQLite
&lt;/h2&gt;

&lt;p&gt;Everything lives in a local SQLite file via &lt;a href="https://drift.simple.dev" rel="noopener noreferrer"&gt;Drift&lt;/a&gt;. Products, orders, customers, inventory, taxes, expenses, returns, tables and an audit log are Drift tables, accessed through DAOs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;daos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="nc"&gt;ProductsDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;OrdersDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;CustomersDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;InventoryDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;TaxDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;ExpensesDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;AuditDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nc"&gt;TablesDao&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With no server, the local schema is the only schema. There is no backend to migrate on your behalf and no way to re-download a user's data if you break it. A bad migration on a shop's device corrupts the only copy of their sales history. So migrations are where I spend the most care.&lt;/p&gt;

&lt;h3&gt;
  
  
  Migrations use the Migrator, not raw SQL
&lt;/h3&gt;

&lt;p&gt;The database is at schema version 15 as I write this. Each upgrade is an &lt;code&gt;if (from &amp;lt; N)&lt;/code&gt; step that goes through Drift's &lt;code&gt;Migrator&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;currentSchemaVersion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;onUpgrade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defaultDiscount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addColumn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defaultDiscountIsPercent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idxOrdersCreatedAt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idxOrdersCustomerId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idxOrderItemsOrderId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The comment in the source explains why: using the Migrator means the DDL is exactly what Drift would generate for a fresh install, including NULL, CHECK and DEFAULT text. Hand-written &lt;code&gt;ALTER TABLE&lt;/code&gt; strings drift (pun intended) from that over time.&lt;/p&gt;

&lt;h3&gt;
  
  
  A test that upgrades every shipped version
&lt;/h3&gt;

&lt;p&gt;The safety net is &lt;code&gt;test/drift/migration_test.dart&lt;/code&gt;. Drift can dump the schema at each version to JSON (&lt;code&gt;drift_schemas/&lt;/code&gt;) and generate helper code from it. The test starts a database at each version that has shipped, runs the real &lt;code&gt;onUpgrade&lt;/code&gt; steps, and checks the result against what the current code expects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;shipped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;shipped&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'upgrade v$from → v${AppDatabase.currentSchemaVersion} yields the expected schema'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;verifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AppDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;addTearDown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;verifier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;migrateAndValidate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;AppDatabase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currentSchemaVersion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A second test opens a fresh in-memory database, which runs &lt;code&gt;createAll&lt;/code&gt;, and validates the live SQLite schema against the generated definitions with dropped-table checking on. If an upgrade path and a fresh install ever disagree, the test fails.&lt;/p&gt;

&lt;p&gt;Schema checks are not enough on their own, because a migration can produce the right shape and still lose data. So there are also data-level tests. One seeds a version 11 database with a line item, runs the migration that drops a column, and asserts the item is still there with the right product name, quantity and total. Another seeds version 8 orders and checks that invoice numbers are back-filled.&lt;/p&gt;

&lt;p&gt;The workflow for any table change is written down: bump &lt;code&gt;currentSchemaVersion&lt;/code&gt;, add the &lt;code&gt;from &amp;lt; N&lt;/code&gt; step, run &lt;code&gt;build_runner&lt;/code&gt;, dump the schema, generate the test helpers, run &lt;code&gt;flutter test test/drift&lt;/code&gt;. It is tedious, and I would still choose it over finding out from a shopkeeper that their orders vanished.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one network-adjacent path: url_launcher
&lt;/h2&gt;

&lt;p&gt;Some features look like they need a network: emailing a receipt, texting a customer, calling a number. The app does not do any of that itself. It builds a link and hands it to the phone's own apps with &lt;code&gt;url_launcher&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;launchUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;LaunchMode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;externalApplication&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The link builders live in &lt;code&gt;lib/core/utils/link_uris.dart&lt;/code&gt;. They produce &lt;code&gt;mailto:&lt;/code&gt; (RFC 6068) and &lt;code&gt;sms:&lt;/code&gt; URIs. One detail was worth getting right: do not build these with &lt;code&gt;Uri(queryParameters: ...)&lt;/code&gt;, because that form-encodes a space as &lt;code&gt;+&lt;/code&gt;, and mail and message apps do not decode it back. A receipt would arrive as "Total+due+12.50". The helpers percent-encode every value instead, so a space is &lt;code&gt;%20&lt;/code&gt; and a literal &lt;code&gt;+&lt;/code&gt; is &lt;code&gt;%2B&lt;/code&gt;. (That fix is in the repo for the next release and is test-verified, not yet confirmed on real devices. The current store builds still have the &lt;code&gt;+&lt;/code&gt; problem.)&lt;/p&gt;

&lt;p&gt;If no app can handle the link, the app copies the text to the clipboard and tells the user. The mail or messaging app does the sending, under its own permissions. openPOS never opens a connection. That is the only category of "network-adjacent" code I allow, and CLAUDE.md names it explicitly. If a future feature genuinely needs network access, the rule is to call it out and get confirmation before wiring it up.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade-offs
&lt;/h2&gt;

&lt;p&gt;Being honest about the costs matters more than the pitch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One device is one register.&lt;/strong&gt; There is no sync, so two phones running openPOS are two independent shops with two independent databases. If you need several tills sharing one inventory, this is the wrong tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No cloud, so no recovery from the cloud.&lt;/strong&gt; If the device is lost and you never exported anything, the data is gone. Backup is on the owner. Data can be exported as CSV, and the repo has an import path for CSV too, so you can move products, customers, orders and expenses between devices yourself. It is manual by design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No remote visibility.&lt;/strong&gt; You cannot check today's sales from home. Reports exist on the device and nowhere else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Less convenient for me.&lt;/strong&gt; No crash reporting means I do not learn about bugs unless someone tells me. That is a real cost and I have accepted it. A privacy claim that depends on "except for a little telemetry" is not the claim I want to make.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is coming
&lt;/h2&gt;

&lt;p&gt;Work on the next release (1.1.0) is in the repo but not in any store build yet, so treat these as upcoming rather than available today: the permission stripping and backup settings described above for Android, stronger backup and restore (streamed snapshots, restore recovery that survives a power cut, receipt photos carried in manual backups), and a few smaller fixes.&lt;/p&gt;

&lt;p&gt;It also adds an &lt;strong&gt;optional usage summary&lt;/strong&gt;. No analytics service, no tracking. The summary is built and shown on the device, and it stays there unless the shopkeeper chooses to send it. Sending is a button that hands the text to WhatsApp or the mail app through &lt;code&gt;url_launcher&lt;/code&gt;, the same path as receipts, so the app's own code still makes no network calls. The relevant code is under &lt;code&gt;lib/features/usage/&lt;/code&gt;, if you want to check that claim yourself rather than take my word for it. This is a deliberate trade: a little feedback from people who choose to give it, instead of telemetry nobody chose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it, read it, help
&lt;/h2&gt;

&lt;p&gt;The code is MIT licensed. If an offline-by-design POS is useful to you, or you just want to read how the manifest, the Drift migrations and the tests fit together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Play: &lt;a href="https://play.google.com/store/apps/details?id=com.brandbuilder.openpos&amp;amp;utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=com.brandbuilder.openpos&amp;amp;utm_source=devto&amp;amp;utm_medium=article&lt;/a&gt;
(the listing is the current build; 1.1.0 is not out yet)&lt;/li&gt;
&lt;li&gt;App Store: &lt;a href="https://apps.apple.com/app/open-pos-offline/id6761003751" rel="noopener noreferrer"&gt;https://apps.apple.com/app/open-pos-offline/id6761003751&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;a href="https://github.com/onepiece92/openPOS" rel="noopener noreferrer"&gt;https://github.com/onepiece92/openPOS&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it is useful, a star on GitHub helps other people find it. Issues and pull requests are welcome, with one house rule: please read the offline-first section of &lt;code&gt;CLAUDE.md&lt;/code&gt; before proposing anything that touches the network.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I'm on the team that builds Open POS. This post was drafted with AI assistance and reviewed against the source code.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>privacy</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
