NmSubscribeSheet class
Subscription purchase flow: plan → summary (method, promo code) → method list → card entry (for card methods) → success.
The library holds no payment logic: onApplyPromo prices a promo code (null = rejected) and onPay charges; an exception from it is shown as a failure. Card details are passed to onPay and never stored.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NmSubscribeSheet
Constructors
-
NmSubscribeSheet({Key? key, required List<
NmPlan> plans, required List<NmPaymentMethodGroup> methodGroups, required Future<void> onPay(NmCheckout checkout), String? initialPlanId, Future<NmPrice?> onApplyPromo(NmPlan plan, String code)?, String summaryLabel(NmPlan plan)?, String? subtitle}) -
Creates an NmSubscribeSheet.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialPlanId → String?
-
Plan preselected on open (defaults to the first).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
methodGroups
→ List<
NmPaymentMethodGroup> -
Payment methods, grouped.
final
-
onApplyPromo
→ Future<
NmPrice?> Function(NmPlan plan, String code)? -
Validates a promo code: the new price, or null when rejected.
final
-
onPay
→ Future<
void> Function(NmCheckout checkout) -
Charges the checkout; an exception is shown as a payment error.
final
-
plans
→ List<
NmPlan> -
Plans to choose from.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subtitle → String?
-
Text under the title on the plan step.
final
- summaryLabel → String Function(NmPlan plan)?
-
Line above the total ("30-day subscription to …").
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NmSubscribeSheet> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
show(
BuildContext context, NmSubscribeSheet sheet) → Future< void> - Opens the flow as a modal bottom sheet (93 % of the screen height).