addItem static method

Future<void> addItem(
  1. String name,
  2. String referenceId,
  3. String sku,
  4. String type,
  5. double unitPrice,
  6. double tax,
  7. double discount,
  8. int quantity,
)

Implementation

static Future<void> addItem(
    String name,
    String referenceId,
    String sku,
    String type,
    double unitPrice,
    double tax,
    double discount,
    int quantity) async {
  try {
    await platform.invokeMethod('addItem', <String, dynamic>{
      'name': name,
      'referenceId': referenceId,
      'sku': sku,
      'type': type,
      'unitPrice': unitPrice,
      'tax': tax,
      'discount': discount,
      'quantity': quantity,
    });
  } on PlatformException catch (e) {
    showToast(e.message.toString());
  }
}