devsnack
Tutorials

Notes from building the templates.

Step-by-step guides on Flutter, Compose and shipping to the stores. Written while solving the problem, not after.

Jetpack Compose

Flows in Compose: Stopping the Collector Does Not Stop the Flow

collectAsStateWithLifecycle ends the screen's subscription and nothing else. The sharing policy that stops the upstream, the flow rebuilt on every recomposition, and the result that never opens because the app was in the background.

15 Sep 2026 · 13 min
Next.js

Double-Booking in Postgres: The Availability Check Is Not a Reservation

Two taps in the same second sell the same room twice, and it never reproduces on your machine. A range column, the constraint that refuses the overlap, the error code to catch, and what happens to a hold nobody pays for.

8 Sep 2026 · 13 min
Flutter

Course Progress in Flutter: The Player Position Is Not Progress

A progress bar that disagrees with itself across two devices, and a lesson download that expires mid-flight. Storing position so it can merge, queueing writes offline, and where a downloaded video actually belongs on disk.

8 Sep 2026 · 14 min
Flutter

Listing Photos in Flutter: The Original Is Not the Asset You Serve

A phone camera makes 5 MB files and a feed of thirty listings makes the bill. Resizing before the upload, signing it so the bytes skip your API route, and the orphaned objects nobody ever deletes.

8 Sep 2026 · 13 min
Multi-vendor delivery

Background Location in a Rider App: The Permission Is the Easy Half

The stream stops when the screen locks and nothing throws. The foreground service type Android 14 wants, the flag iOS wants, and the form a human at Play reads before any of it ships.

2 Sep 2026 · 13 min
Flutter

AI Features in Flutter: The Model Returns Text, Not a Type

Asking for JSON works forty times, then doesn't. Constraining the shape in the request, the two failures a strict schema does not remove, and where to put the parse.

2 Sep 2026 · 13 min
Kotlin

Storing Money in Room: Every Balance Bug Starts as a Double

A dashboard that disagrees with the sum of its own rows by a penny. Minor units as a Long, the currencies where multiplying by 100 is wrong, and the JSON round trip that undoes it.

2 Sep 2026 · 12 min
Flutter

Play App Signing: The Key You Generate Is Not the Key That Ships

Google re-signs your bundle with a key you have never held. Which loss is recoverable, which is terminal, and why Google Sign-In works in debug and fails on launch day.

28 Aug 2026 · 12 min
Monetization / AdMob

AdMob Test Ads: A Demo Unit Id Is Not Test Mode

Demo units cover the debug build and nothing else. Registering a test device, the consent call that must land first, and the permission the SDK declares for you.

28 Aug 2026 · 11 min
Multi-vendor delivery

Five Ways to Launch a Delivery Marketplace, Honestly Compared

White-label, template, agency, in-house, no-code. What you own in each, what it costs by year three, and what you are physically holding on the day you decide to leave.

25 Aug 2026 · 11 min
Multi-vendor delivery

Build or Buy a Delivery Marketplace: A Template Saves the Boring Two-Thirds

Thirty-five engineer-weeks of solved problems is what you are buying. Dispatch tuning, zone design and unit economics are not on that list, and no template ships them.

25 Aug 2026 · 10 min
Monetization / AdMob

Buying a Template Does Not Get You Rejected. Shipping Forty of Them Does.

Guideline 4.2.6 is about who submits, not what the codebase started as. Where the line falls, why 4.3 catches unfinished rebrands, and the checks that fail first submissions.

25 Aug 2026 · 11 min
Multi-vendor delivery

Delivery Zones in PostGIS: Stop Storing a Radius

A circle accepts the flat across the river and refuses the estate down the dual carriageway. Polygons, geography over geometry, and why ST_Contains is the wrong function.

25 Aug 2026 · 12 min
Multi-vendor delivery

Stripe Connect: The Charge Type Decides Who Eats the Chargeback

Direct, destination, and separate charges and transfers are not three styles of the same thing. They decide whose balance a dispute comes out of, and only one splits a cart.

25 Aug 2026 · 13 min
Multi-vendor delivery

Order Status over FCM: The Notification Is Not the Source of Truth

Messages collapse, arrive out of order and never arrive at all. Send the order id and refetch, why Apple rejects the priority you set, and the token rotation that fails quietly.

25 Aug 2026 · 12 min
Monetization / AdMob

In-App Subscriptions in Flutter: The Purchase Callback Is Not Proof of Payment

A local isPro boolean is forgeable, lost on reinstall and never expires. Purchase tokens, server-side verification, and the three-day window that silently refunds Android purchases.

19 Aug 2026 · 13 min
Flutter

Where to Put Your OpenAI API Key in a Flutter App: Not in the App

Every trick for hiding a key in a binary loses to unzip and strings. The one route handler that fixes it, streaming included, and what to do if you already shipped one.

18 Aug 2026 · 12 min
Multi-vendor delivery

Assigning Orders to Riders: Why Nearest-First Is the Wrong Algorithm

Dispatch is a matching problem, not a search problem. A three-second batch window, a cost function measured in seconds, and the Routes API bill that catches everyone.

12 Aug 2026 · 12 min
Multi-vendor delivery

What It Costs to Run a Multi-Vendor Delivery App: Firebase and Maps, Line by Line

Current Firestore, Realtime Database and Google Maps pricing applied to a thousand orders a month. The same app bills $21 or $1,770, and one await decides which.

12 Aug 2026 · 12 min
Multi-vendor delivery

Splitting a Cart Across Multiple Vendors: Data Model and Checkout Flow

One cart, several sellers, one payment, and every vendor fulfilling independently. The schema that makes it work, and the three places it usually breaks.

11 Aug 2026 · 11 min
Kotlin

Room and Coroutines: Offline-First Data in a Compose App

The write path, the read path, and what to do when the network comes back. One decision drives all of it: the database is the source of truth.

11 Aug 2026 · 13 min
Next.js

Building an Admin Panel for Your Mobile App with Next.js and Supabase

Row-level security, a typed client, and a dashboard you can hand to a non-developer — plus the one key that must never reach the browser.

11 Aug 2026 · 15 min
Jetpack Compose

Type-Safe Navigation in Compose Without Adding a Library

One file owns every route, nothing else writes a route string, and no more string concatenation in your deep links.

11 Aug 2026 · 9 min
Monetization / AdMob

AdMob in Flutter: Banner, Interstitial and Rewarded Ads Without the Crashes

Ad loading is asynchronous and your widget tree is not. A pattern that keeps the two apart, and the frame where interstitials go wrong.

11 Aug 2026 · 11 min
Flutter

How to Change the App Name, Package ID and Icon in a Flutter Project

Every template you buy ships with someone else's bundle id. Here is the complete list of files to touch on Android and iOS, and the two places people always forget.

11 Aug 2026 · 8 min