materialAndBatchOk static method

bool materialAndBatchOk({
  1. required String orderMaterial,
  2. required String? material,
  3. String? orderBatch,
  4. String? batch,
})

Implementation

static bool materialAndBatchOk({
  required String orderMaterial,
  required String? material,
  String? orderBatch,
  String? batch,
}) {
  bool materialIsOk = orderMaterial == material;
  bool batchIsOk = orderBatch != null
      ? orderBatch == batch
      : batch?.isEmpty ?? true;

  return materialIsOk && batchIsOk;
}