removeFromCart method
Remove item from cart.
Removes a specific item from the shopping cart.
itemId
the ID of the cart item to remove
Returns true
if item was removed successfully, false
otherwise.
Implementation
@override
Future<bool> removeFromCart(String itemId) async {
try {
final result = await methodChannel.invokeMethod<bool>('removeFromCart', {
'itemId': itemId,
});
return result ?? false;
} catch (e) {
_error = e.toString();
return false;
}
}