getProduct method
Get product by SKU.
Retrieves detailed information about a specific product using its SKU.
sku
the product's SKU (Stock Keeping Unit)
Returns a map containing the product details, or null
if not found.
Implementation
@override
Future<Map<String, dynamic>?> getProduct(String sku) async {
try {
final result = await methodChannel.invokeMethod<Map<String, dynamic>>(
'getProduct',
{'sku': sku},
);
return result;
} catch (e) {
_error = e.toString();
return null;
}
}