Flutter RevenueCat Paywall: Build It or Use Theirs

· 5 min read

RevenueCat gives Flutter apps two ways to show a paywall. You can use its Paywalls feature, which renders a paywall you design in the RevenueCat dashboard, or you can build your own Flutter screen and use RevenueCat only for products, purchases and entitlements.

Both are valid. This post shows the code for each and how to choose. It is part of our guide to building a Flutter app with Claude Code.

The shared foundation: Offerings and entitlements

Either way, you set up the same things in RevenueCat first:

  • Products that match your App Store Connect and Play Console product IDs.
  • Entitlements, such as pro, that represent what the user gets.
  • Offerings, which group the packages (monthly, yearly) you show on a paywall.

RevenueCat describes a Paywall as “an optional feature of your Offering.” So the Offering decides what is sold, and the Paywall decides how it looks.

Install

flutter pub add purchases_flutter purchases_ui_flutter

purchases_flutter is the core SDK. purchases_ui_flutter adds UI components, including Paywalls and Customer Center. RevenueCat’s install guide lists these requirements:

  • Flutter 3.22 or later.
  • Android: Kotlin 2.1.0 or later and compileSdk 35 or higher.
  • iOS with CocoaPods: deployment target 13.0 or higher. New Flutter projects using Swift Package Manager need no extra setup.
  • Enable the In-App Purchase capability in Xcode before App Store distribution.

Two Android changes are easy to miss. The purchasing Activity’s launchMode must be standard or singleTop, and for Paywalls, MainActivity must extend FlutterFragmentActivity:

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity()

Option A: RevenueCat Paywalls

RevenueCat’s pitch for this option: “RevenueCat Paywalls let you remotely configure your entire paywall view without any code changes or app updates.” You pick a template, start from scratch or describe the design in their AI editor, and multi-step flows are supported on recent SDKs.

Present it as a full screen:

import 'package:purchases_ui_flutter/purchases_ui_flutter.dart';

Future<void> showPaywall() async {
  final result = await RevenueCatUI.presentPaywall();
  log('Paywall result: $result');
}

Present it only when the user lacks an entitlement:

final result = await RevenueCatUI.presentPaywallIfNeeded('pro');

This is the simplest gate for premium features: call it when the user taps a locked feature, and it does nothing if they already have pro.

Embed it in your own screen:

Scaffold(
  body: SafeArea(
    child: PaywallView(
      onDismiss: () => context.pop(),
      onRestoreCompleted: (customerInfo) {
        // Called after restore, even if nothing was granted.
      },
    ),
  ),
);

PaywallView also takes onPurchaseStarted, onPurchaseCompleted, onPurchaseError and onRestoreError. RevenueCat’s docs warn against placing it “inside a modal or bottom sheet (e.g., using showModalBottomSheet).” Put it directly in a route.

If an Offering has no usable paywall, the SDK falls back to a default one that lists all its packages. That is a safety net, not a design.

Platform support. RevenueCat lists iOS 15.0+ and Android 7.0 (API 24)+ for Paywalls, and some features need newer SDK versions. Check the minimums table in their docs against the version you install.

Option B: your own Flutter paywall

Here you fetch Offerings and build any UI you like. The purchase call from RevenueCat’s docs:

try {
  final params = PurchaseParams.package(package);
  final result = await Purchases.purchase(params);
  final isPro =
      result.customerInfo.entitlements.all['pro']?.isActive ?? false;
  if (isPro) {
    // Grant access.
  }
} on PlatformException catch (e) {
  final code = PurchasesErrorHelper.getErrorCode(e);
  if (code != PurchasesErrorCode.purchaseCancelledError) {
    showError(e);
  }
}

Note the cancellation check. A user closing the store sheet is not an error and should not show an error dialog.

With your own UI you also own:

  • loading and error states while Offerings load,
  • showing store-provided prices (never hardcoded),
  • the restore button,
  • trial wording and terms links,
  • accessibility and text scaling.

Our mobile app paywall design post covers layout and copy, and Flutter in-app purchase with StoreKit 2 covers what happens underneath.

How to choose

RevenueCat Paywalls Custom Flutter paywall
Change design without a release Yes No (copy only, if remote config)
Match your app’s design system exactly Close, via the editor Exactly
Code to maintain Very little A full screen plus states
Android setup FlutterFragmentActivity required Standard
Embedding in a bottom sheet Not recommended Your choice

Use RevenueCat Paywalls if you want to test pricing and layout often, you are shipping your first subscription app, or you do not want to maintain the edge cases.

Build your own if the paywall is part of a custom onboarding flow, you need it in a bottom sheet, or your design system is strict.

A middle path works well: launch with RevenueCat Paywalls, learn which plan and layout convert, then rebuild that winner in Flutter if you need tighter design control.

Common problems

  • Paywall never appears on Android. MainActivity still extends FlutterActivity. Switch it to FlutterFragmentActivity.
  • Empty or default paywall. The current Offering has no paywall attached, or its products are not available in the store yet. Check the Offering in the dashboard and confirm the product IDs match the stores.
  • Paywall shown to paying users. Use presentPaywallIfNeeded('pro'), or check the entitlement before showing your custom screen.
  • Error dialog after the user cancels. Filter out purchaseCancelledError, as in the snippet above.
  • Restore shows nothing. RevenueCat notes the restore callback “may be called even if no entitlements have been granted,” so tell the user when nothing was found.

Cost

RevenueCat’s pricing page says it is free until you pass $2.5K in monthly tracked revenue, then 1% of tracked revenue, and lists Paywalls among the tools included. Check the page for current terms before you commit.

Before you submit

Whichever option you pick, the store rules are the same. The price, billing period and trial terms must be clear, and restore must work. Read guideline 3.1.1 in-app purchase and the Google Play subscriptions policy, and run the test plan in how to test in-app purchases in Flutter. For pricing strategy, see how to make a subscription app.

MobileKit’s paywall skill covers both routes, with the store-required states included.

Sources read on the day this post was written: RevenueCat Paywalls, RevenueCat: displaying paywalls, RevenueCat: Flutter installation, RevenueCat: making purchases and RevenueCat pricing.

Questions

Which package do I need for RevenueCat Paywalls in Flutter?

purchases_flutter is the core SDK and purchases_ui_flutter provides the UI components, including Paywalls. Install both with flutter pub add purchases_flutter purchases_ui_flutter.

Can I change a RevenueCat paywall without an app update?

Yes. RevenueCat says its Paywalls let you remotely configure your entire paywall view without any code changes or app updates. A custom Flutter paywall needs a new release for layout changes.

Why does my RevenueCat paywall not show on Android?

RevenueCat's Flutter install guide says MainActivity must subclass FlutterFragmentActivity instead of FlutterActivity for Paywalls, and the purchasing Activity's launchMode should be standard or singleTop.

Try it on your next idea

One payment, every update to this major version, and a refund window if it is not for you. Refund policy.