Limited Offer Sheet
fun LimitedOfferSheet(plan: PaywallPlan, originalPrice: String, discountLabel: String, offerEndsAtMillis: Long, legal: PaywallLegal, onPurchase: (PaywallPlan) -> Unit, onRestore: () -> Unit, onClose: () -> Unit, modifier: Modifier = Modifier, title: String = stringResource(R.string.pw_offer_title), subtitle: String = stringResource(R.string.pw_offer_subtitle), offerDurationMillis: Long = 15 * 60_000L, sheetState: SheetState = rememberBottomSheetState(SheetValue.Hidden, setOf(SheetValue.Hidden, SheetValue.Expanded)))(source)
Design 5, limited-time offer: a modal bottom sheet with a big discount, the struck-through original price, a live countdown and a wavy progress bar that drains as time runs out. Show it on top of any screen; it dismisses through onClose.
Parameters
plan
the discounted plan. Its price is the offer price.
original Price
regular price shown struck through, e.g. "$59.99".
discount Label
short discount text, e.g. "-50%".
offer Ends At Millis
wall-clock time (System.currentTimeMillis()) when the offer ends.
offer Duration Millis
full length of the offer, used to scale the wavy progress bar.
See also
for the shared parameters.