- Print
Step6. Handling product clicks
- Print
When a user selects a product or taps the cart button on the Shoplive Player screen, the Shoplive Flutter SDK delivers the corresponding event and selected information to the client.
Event Delivery Using Handler Functions
CLICK_PRODUCT_DETAIL
When a user selects a product from the product list on the Shoplive Player screen, the Shoplive Flutter SDK delivers the selected product information to the client via the receivedCommand callback.
CLICK_PRODUCT_CART
When a user taps the Add to Cart button from the product list on the Shoplive Player screen, the Shoplive Flutter SDK delivers the cart-related information to the client via the receivedCommand callback.
_shopLivePlayer.receivedCommand.listen((data) {
// print("handleReceivedCommand: ${data.command} data: ${data.data}");
// Command: CLICK_PRODUCT_CART
});API Reference: receivedCommand
handleNavigation
When a user selects an item such as a product or banner on the live broadcast screen, the Shoplive Flutter SDK delivers the selected item’s URL information to the client via the handleNavigation callback.
_shopLivePlayer.handleNavigation.listen((data) {
String url = data.url;
print("handleNavigation $url");
// Handle the URL according to your app logic
});API Reference: handleNavigation