onCustomClickCartIcon property Null safety

CustomClickCartIconCallback? onCustomClickCartIcon

This callback is triggered when the user clicks the shopping cart icon.

The host app can customize the processing logic of clicking the shopping cart icon by setting the callback. In the callack, you could call FireworkSDK.getInstance().navigator.popNativeContainer to close the player and call navigation.navigate to push the RN cart page. Currently, there is be a limitation on the iOS side when you set the callback. That is, if you set the callback, you need to call FireworkSDK.getInstance().navigator.popNativeContainer in the callback. Otherwise there will be bugs on the iOS side.

Implementation

CustomClickCartIconCallback? get onCustomClickCartIcon =>
    _onCustomClickCartIcon;
void onCustomClickCartIcon=(CustomClickCartIconCallback? onCustomClickCartIcon)

Implementation

set onCustomClickCartIcon(
    CustomClickCartIconCallback? onCustomClickCartIcon) {
  _onCustomClickCartIcon = onCustomClickCartIcon;
  final nativeMethodName = FWShoppingMethodNameUtil.convertToNativeMethod(
    FWShoppingNativeMethodName.setCustomClickCartIconEnabled,
  );
  FWMethodChannelUtil.getShoppingChannel().invokeMethod(
    nativeMethodName,
    onCustomClickCartIcon != null,
  );
}