//return SizedBox.shrink(); // empty box, could be content above the paywall
// takes same space return Text('Custom content above the paywall, bottomPadding: $bottomPadding');
},
);
},
);
}
Appearance:
Too much space above packages, how can I get rid of it? Seems to be some padding? BottomPadding is just 20px
Best answer by jeffrey_bunn
@ingoa Thanks for logging this, and I apologize for the issue. Cesar, an engineer on our team, replied to a GitHub issue on this here, and I’ve copied his answer below for reference.
---
By looking at your code in that community post, your workaround is how PaywallFooterView is supposed to work. What you pass in contentCreator is meant to be the top of the screen "above" the footer paywall. It's done that way so it's easier to set the bottom padding (for the rounded top corners of the paywall)
import'package:purchases_ui_flutter/purchases_ui_flutter.dart';
// In your own Widget:
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: PaywallFooterView(
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 ifno entitlements have been granted.
},
onDismiss: () {
// Dismiss the paywall, i.e. remove the view, navigate to another screen, etc.
// Will be called when a purchase succeeds.
},
contentCreator: (bottomPadding) => YourPaywall(bottomPadding),
),
),
),
);
}
Workaround: Use PaywallFooterView() as body of a screen you navigate to. Put contentCreator Widget in a SingleChildScrollView, and throw in all the content you want.
@ingoa Thanks for logging this, and I apologize for the issue. Cesar, an engineer on our team, replied to a GitHub issue on this here, and I’ve copied his answer below for reference.
---
By looking at your code in that community post, your workaround is how PaywallFooterView is supposed to work. What you pass in contentCreator is meant to be the top of the screen "above" the footer paywall. It's done that way so it's easier to set the bottom padding (for the rounded top corners of the paywall)
import'package:purchases_ui_flutter/purchases_ui_flutter.dart';
// In your own Widget:
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: PaywallFooterView(
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 ifno entitlements have been granted.
},
onDismiss: () {
// Dismiss the paywall, i.e. remove the view, navigate to another screen, etc.
// Will be called when a purchase succeeds.
},
contentCreator: (bottomPadding) => YourPaywall(bottomPadding),
),
),
),
);
}
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.