Launch Try-On Flow
Embed a complete, pre-configured try-on UI experience with a single function call.
Use SnapIT.launchTryOnFlow to trigger the try-on bottom sheet experience. The SDK handles asset selection, camera/gallery permissions, uploads, progress indications, rendering, and result visualization automatically.
Usage Example
import 'package:snapit_sdk/snapit_sdk.dart';
SnapIT.launchTryOnFlow(
context: context,
apiKey: "smd_live_your_key_here",
userId: "user_abc123",
garmentImageUrl: "https://apisdk.snapmydesign.com/sample/tshirt.png",
productId: "sku_shirt_123", // Optional SKU/product ID tracking
externalUserId: "consumer_user_771", // Optional customer tracking
onSuccess: (resultImageUrl, generationId) {
print("Try-On Completed! Output URL: $resultImageUrl");
},
onFailure: (errorMessage) {
print("Try-On Failed: $errorMessage");
},
);