lookup static method

SymbolInfo? lookup(
  1. int dataCodewords, [
  2. Object? shapeOrIsRect,
  3. Object? minSizeOrFail,
  4. Dimension? maxSize,
  5. bool fail = true,
])

Implementation

static SymbolInfo? lookup(
  int dataCodewords, [
  Object? shapeOrIsRect,
  Object? minSizeOrFail,
  Dimension? maxSize,
  bool fail = true,
]) {
  late SymbolShapeHint shape;
  Dimension? minSize;
  if (shapeOrIsRect is bool) {
    shape = shapeOrIsRect
        ? SymbolShapeHint.forceNone
        : SymbolShapeHint.forceSquare;
  } else {
    shape = shapeOrIsRect == null
        ? SymbolShapeHint.forceNone
        : (shapeOrIsRect as SymbolShapeHint);
  }

  if (minSizeOrFail is bool) {
    fail = minSizeOrFail;
  } else {
    minSize = minSizeOrFail as Dimension?;
  }
  return _lookup(dataCodewords, shape, minSize, maxSize, fail);
}