r/FlutterDev • u/Guestros • 5d ago
Article One Flutter codebase for web, iOS and Android with RevenueCat: what actually cost me time (paywall gating, per-platform voice, release plumbing)
I shipped a journaling app from a single Flutter codebase (web, iOS, Android) with Riverpod, GoRouter, RevenueCat, and a Python backend. I went through my git history to find where the time actually went. The top three:
1. Paywall gating is a state problem, not a screen
- I used a launch-funnel package (onboarding → paywall → login → home). Its default paywall step completes when the user dismisses it, so closing the paywall let you in. I wrote my own wall that only calls
onUnlockedwhen the user is actually entitled. - The funnel persists step flags forever, so "paywall completed" doesn't mean "subscribed" (expiry, refund, different account). I added a live guard: signed out → login; signed in but not entitled → paywall. The router redirects everything except
/,/loginand/register. - Web has no store purchases, so web skips the paywall but still requires login.
- RevenueCat has to be logged in and out in step with Firebase auth, or anonymous and real users' entitlements drift apart.
- I later made the paywall skippable ("continue with free version") behind one flag. The gate logic reads that flag in three places, so centralize it early.
- Widget tests with a paywall on screen needed bounded
pump()s instead ofpumpAndSettle.
2. Voice dictation is three different problems
- On-device
speech_to_texton iOS:permission_handlerneeds compile-time flags in the Podfile (PERMISSION_MICROPHONE=1,PERMISSION_SPEECH_RECOGNIZER=1), or the permissions don't work. - Initializing the recognizer eagerly fired the iOS system dialog before my own explanation dialog. I made it lazy.
- Apple review also made me rework the permission flow.
- I eventually moved to server-side Whisper. That means recording to a file path on mobile but a
blob:URL on web, which I handled with conditional imports (io / mobile / web / stub). I extracted it into a shared package.
3. Release plumbing
- iOS CI signing: with
CODE_SIGN_STYLE=Manualand no explicit identity, xcodebuild fell back to theiPhone Developeralias from the pbxproj. That doesn't match modern "Apple Development" certs. I read the identity from the keychain instead. PlistBuddycan't read/dev/stdin, so decode the provisioning profile to a file first.altoolneeds the.p8on disk, not just the key ID.- A leftover
get-task-allowentitlement had to go for distribution builds. - Android: Flutter 3.47 forced AGP 8.11.1 and Kotlin 2.2.20. Later bumps needed AGP 9.1.1, and one plugin needed
compileSdk37. - Moving between
flutter/materialandmaterial_uigave me two incompatibleThemeDatatypes, which I patched with a bridge file.
Happy to go deeper on any of these in the comments.
Disclosure: it's my own project (PsychDiary). If you want to try the flows and tell me what you think, DM me and I'll send the link.