Skip to main content
Question

Can't implement hard paywalls with the Flutter SDK

  • February 19, 2025
  • 2 replies
  • 68 views

petme
Forum|alt.badge.img

We are trying to implement hard paywalls with the flutter SDK, not luck so far.

We have tried:
 

RevenueCatUI.presentPaywallIfNeeded()

RevenueCatUI.presentPaywall


And honesty WE don’t see a big difference between them.

Any of you have found a workaround?

If anyone is interested the app is called Petme.


 

This post has been closed for comments

2 replies

jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 240 replies
  • February 21, 2025

Hi ​@petme! To implement a hard paywall, please use the full PaywallView widget instead of the presentPaywall methods. For example:

import 'package:purchases_ui_flutter/purchases_ui_flutter.dart';

// Note: Avoid placing PaywallView inside a modal or bottom sheet (e.g., using showModalBottomSheet).
// Instead, include it directly in your widget.
@override
Widget build(BuildContext context) {
  return Scaffold(
    body: SafeArea(
      child: Center(
        child: PaywallView(
          offering: offering, // Optional Offering object obtained through getOfferings
          onRestoreCompleted: (CustomerInfo customerInfo) {
            // Optional listener. Called when a restore has been completed.
            // This may be called even if no entitlements have been granted.
          } 
          onDismiss: () {
            // Dismiss the paywall, i.e. remove the view, navigate to another screen, etc.
            // Will be called when the close button is pressed (if enabled) or when a purchase succeeds.
          },
        ),
      ),
    ),
  );
}

Thanks!


petme
Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • February 21, 2025

Thanks ​@jeffrey_bunn ! We will try it out.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings