getProduct method

  1. @override
Future<Map<String, dynamic>?> getProduct(
  1. String sku
)
override

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;
  }
}