MigrationTipView class

Embeds the native ZeroSettle offer tip inside a Flutter app: SwiftUI OfferTipView on iOS (from ZeroSettleKit), Compose ZeroSettleOfferTip on Android (from ZeroSettle-Android :ui).

Both are the unified, ZSOfferManager-backed tip — they resolve the active user from identify(_:), so call ZeroSettle.instance.identify(...) once before this widget mounts.

The native view is intrinsically self-sizing — its height changes based on event state (CTA swap when Apple Pay needs setup, dismissal, loading state, etc.). A fixed SizedBox would either clip taller content or reserve dead space when the view collapses.

This widget subscribes to a per-view MethodChannel that the native container pushes size updates to whenever its layout fires. The wire shape (setSize with {height: Double}) and channel name format (zerosettle/migrate_tip_view_<viewId>) are identical on both platforms, so the height-bridge code is platform-agnostic. Flutter rebuilds with the new height, so the surrounding layout always matches the actual rendered content.

The PlatformView viewType differs by platform (iOS uses zerosettle/migrate_tip_view, Android uses com.zerosettle/migrate_tip_view) — this matches each platform's factory registration (ZSMigrateTipViewFactory.swift:188 / MigrateTipViewFactory.kt).

Renders an empty SizedBox.shrink() on platforms other than iOS and Android (e.g. desktop, web).

Example:

MigrationTipView(
  backgroundColor: Theme.of(context).colorScheme.primary,
)
Inheritance

Constructors

MigrationTipView({Key? key, @Deprecated('Identify-first: the offer tip resolves the user from identify(_:). ' 'This parameter is ignored; will be removed in zerosettle 2.0.') String userId = '', Color backgroundColor = const Color(0xFF000000)})
const

Properties

backgroundColor Color
Used as both the card fill AND the CTA text color on the native view (the CTA button background is hardcoded white). Pass a saturated brand color, not a neutral surface — white-on-white text won't render.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userId String
(Deprecated) Legacy user identifier. The native offer tip is identify-first — it resolves the active user from ZeroSettle.instance.identify(...) — so this value is ignored on both platforms. Retained for source compatibility; removed in zerosettle 2.0.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MigrationTipView>
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