MigrationManager class
Handle for ZeroSettleKit's ZSMigrationManager. Adopters obtain a handle
via ZeroSettle.migrationManager and use it to drive a fully custom
migration UI.
State changes from the iOS-side @Published properties are delivered via
stateUpdates. Imperative methods (present, dismiss, startCheckout,
etc.) drive the iOS Kit manager. Adopters should call dispose when the
owning widget tears down to release the per-handle channel subscriptions
— the iOS-side manager is cached per (userId, stripeCustomerId) and
outlives the handle.
Constructors
- MigrationManager.fromHandleId(String _handleId)
Properties
-
checkoutFailures
→ Stream<
CheckoutFailure> -
Hot stream of checkout failures. Replaces ZSMigrationManager's
onCheckoutFailureclosure callback.no setter - handleId → String
-
The opaque handle ID issued by the iOS bridge. Exposed for diagnostics
(e.g. logging which handle a state event came from).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stateUpdates
→ Stream<
MigrationManagerState> -
Hot stream of state updates. Emits a coherent snapshot of all five
@Publishedproperties on every change. Late subscribers receive the current state on subscribe.no setter
Methods
-
dismiss(
) → Future< void> - Dismiss the offer (persists to UserDefaults on iOS).
-
dispose(
) → Future< void> -
Tear down per-handle channel subscriptions. The iOS-side manager
instance is NOT released — it's cached per
(userId, stripeCustomerId)and survives across handle disposals. Calling ZeroSettle.migrationManager again returns a new handle bound to the same underlying state. -
getState(
) → Future< MigrationManagerState> - Read the current state once.
-
markCheckoutSucceeded(
{String? transactionId}) → Future< void> -
Mark the checkout as succeeded; transitions state toward
accepted. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
present(
) → Future< void> -
Transition the offer into the
presentedstate. -
showAppleSubscriptionManagement(
) → Future< void> -
Open Apple's subscription management UI for the user to cancel their
StoreKit auto-renew. Transitions state toward
completed. -
startCheckout(
{String? stripeCustomerId}) → Future< Uri?> - Start the web checkout flow. Returns the checkout URL or null on failure. Errors are delivered via checkoutFailures when available.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isPermanentlyDismissed(
{required String userId}) → Future< bool> - Whether the user has permanently dismissed the offer (UserDefaults).
-
resetDismissedState(
) → Future< void> - Reset dismissed state for ALL users (debug-only).
-
setDismissed(
bool dismissed, {required String userId}) → Future< void> -
Set the dismissed flag for
userId.