productof static method

String productof(
  1. String? qty,
  2. String? price
)

Implementation

static String productof(String? qty, String? price) {
  int quantity = int.tryParse(qty ?? '1') ?? 1;
  double itemPrice = double.tryParse(price ?? '0') ?? 0;
  double product = quantity * itemPrice;

  return product.toStringAsFixed(2);
}