generate method

TransformationData generate(
  1. int? width,
  2. int? height,
  3. String? image,
  4. int? margin,
  5. int? qRTypeNumber,
  6. QrQrerrorcorrectionlevel? qrErrorCorrectionLevel,
  7. double? imageSize,
  8. int? imageMargin,
  9. String? dotsColor,
  10. QrDotsType? dotsType,
  11. String? dotsBgColor,
  12. String? cornerSquareColor,
  13. QrCornersquareType? cornerSquareType,
  14. String? cornerDotsColor,
  15. QrCornerdotsType? cornerDotsType,
)

Method for QRCode Plugin

  • width : width (Default: 300)
  • height : height (Default: 300)
  • image : image (Default: )
  • margin : margin (Default: 0)
  • qRTypeNumber : qRTypeNumber (Default: 0)
  • qrErrorCorrectionLevel : QrQrerrorcorrectionlevel (Default: Q)
  • imageSize : imageSize (Default: 0.4)
  • imageMargin : imageMargin (Default: 0)
  • dotsColor : dotsColor (Default: "000000")
  • dotsType : QrDotsType (Default: square)
  • dotsBgColor : dotsBgColor (Default: "ffffff")
  • cornerSquareColor : cornerSquareColor (Default: "000000")
  • cornerSquareType : QrCornersquareType (Default: square)
  • cornerDotsColor : cornerDotsColor (Default: "000000")
  • cornerDotsType : QrCornerdotsType (Default: dot) Returns TransformationData.

Implementation

TransformationData generate(
  int? width,
  int? height,
  String? image,
  int? margin,
  int? qRTypeNumber,
  QrQrerrorcorrectionlevel? qrErrorCorrectionLevel,
  double? imageSize,
  int? imageMargin,
  String? dotsColor,
  QrDotsType? dotsType,
  String? dotsBgColor,
  String? cornerSquareColor,
  QrCornersquareType? cornerSquareType,
  String? cornerDotsColor,
  QrCornerdotsType? cornerDotsType,
) {
  var values = <String, String>{};
  if (width != null) {
    values['w'] = width.toString();
  }
  if (height != null) {
    values['h'] = height.toString();
  }
  if (image != null) {
    values['i'] = image.toString();
  }
  if (margin != null) {
    values['m'] = margin.toString();
  }
  if (qRTypeNumber != null) {
    values['qt'] = qRTypeNumber.toString();
  }
  if (qrErrorCorrectionLevel != null) {
    values['qe'] = qrErrorCorrectionLevel.value;
  }
  if (imageSize != null) {
    values['is'] = imageSize.toString();
  }
  if (imageMargin != null) {
    values['im'] = imageMargin.toString();
  }
  if (dotsColor != null && dotsColor.isNotEmpty) {
    values['ds'] = dotsColor;
  }
  if (dotsType != null) {
    values['dt'] = dotsType.value;
  }
  if (dotsBgColor != null && dotsBgColor.isNotEmpty) {
    values['bg'] = dotsBgColor;
  }
  if (cornerSquareColor != null && cornerSquareColor.isNotEmpty) {
    values['csc'] = cornerSquareColor;
  }
  if (cornerSquareType != null) {
    values['cst'] = cornerSquareType.value;
  }
  if (cornerDotsColor != null && cornerDotsColor.isNotEmpty) {
    values['cdc'] = cornerDotsColor;
  }
  if (cornerDotsType != null) {
    values['cdt'] = cornerDotsType.value;
  }
  return TransformationData(plugin: 'qr', name: 'generate', values: values);
}