BarCodeImage<T extends BarCodeParams?> constructor

BarCodeImage<T extends BarCodeParams?>({
  1. @deprecated String? data,
  2. @deprecated BarCodeType? codeType,
  3. @deprecated double lineWidth = 2.0,
  4. @deprecated double barHeight = 100.0,
  5. @deprecated bool hasText = false,
  6. BarCodeParams? params,
  7. EdgeInsets? padding,
  8. Color? backgroundColor,
  9. Color foregroundColor = const Color(0xFF000000),
  10. BarCodeError? onError,
})

Implementation

BarCodeImage({
  @deprecated this.data,
  @deprecated this.codeType,
  @deprecated this.lineWidth = 2.0,
  @deprecated this.barHeight = 100.0,
  @deprecated this.hasText = false,
  BarCodeParams? params,
  this.padding,
  this.backgroundColor,
  Color foregroundColor = const Color(0xFF000000),
  this.onError,
})  : assert(params != null || (data != null && codeType != null),
          "params or data+codeType must be set"),
      assert(
          (params != null && data == null && codeType == null) ||
              (params == null && data != null && codeType != null),
          "params and data+codeType cannot be set at the same time"),
      _painter = BarCodePainter(
          params ??
              _getBarcodeParams(
                  codeType!, data, lineWidth, barHeight, hasText),
          foregroundColor,
          onError: onError);