onSdkWillNavigateToTarget property

Future<bool> Function(IaSdkNavigationTarget navigationTarget)? onSdkWillNavigateToTarget
getter/setter pair

Called when the SDK is about to navigate to a destination that the host app can override.

For example, if the SDK would present the cart screen contents, the host app can switch to its own contents by returning false.

Return true to let the SDK proceed with its built-in presentation.

Usage:

IaSdk.instance.onSdkWillNavigateToTarget = (navigationTarget) async {
  if (navigationTarget == SdkNavigationTarget.cart) {
    // Switch to your own cart tab.
    switchToTab(TabType.cart);
    return false;
  }
  return true;
};

Implementation

Future<bool> Function(
  IaSdkNavigationTarget navigationTarget,
)?
onSdkWillNavigateToTarget;