getBarcodeGenerate method
Future<Uint8List>
getBarcodeGenerate(
- String type,
- String text, {
- String? twoDDisplayText,
- String? textLocation,
- String? textAlignment,
- String? textColor,
- String? fontSizeMode,
- bool? noWrap,
- double? resolution,
- double? resolutionX,
- double? resolutionY,
- double? dimensionX,
- double? textSpace,
- String? units,
- String? sizeMode,
- double? barHeight,
- double? imageHeight,
- double? imageWidth,
- double? rotationAngle,
- String? backColor,
- String? barColor,
- String? borderColor,
- double? borderWidth,
- String? borderDashStyle,
- bool? borderVisible,
- String? enableChecksum,
- bool? enableEscape,
- bool? filledBars,
- bool? alwaysShowChecksum,
- double? wideNarrowRatio,
- bool? validateText,
- String? supplementData,
- double? supplementSpace,
- double? barWidthReduction,
- bool? useAntiAlias,
- String? format,
Generate barcode.
Implementation
Future<Uint8List> getBarcodeGenerate(String type, String text,
{String? twoDDisplayText,
String? textLocation,
String? textAlignment,
String? textColor,
String? fontSizeMode,
bool? noWrap,
double? resolution,
double? resolutionX,
double? resolutionY,
double? dimensionX,
double? textSpace,
String? units,
String? sizeMode,
double? barHeight,
double? imageHeight,
double? imageWidth,
double? rotationAngle,
String? backColor,
String? barColor,
String? borderColor,
double? borderWidth,
String? borderDashStyle,
bool? borderVisible,
String? enableChecksum,
bool? enableEscape,
bool? filledBars,
bool? alwaysShowChecksum,
double? wideNarrowRatio,
bool? validateText,
String? supplementData,
double? supplementSpace,
double? barWidthReduction,
bool? useAntiAlias,
String? format}) async {
// ignore: prefer_final_locals
Object? postBody = null;
// create path and map variables
final String requestPath =
"/barcode/generate".replaceAll("{format}", "json");
// query params
final List<QueryParam> queryParams = [];
final Map<String, String> headerParams = {};
final Map<String, String> formParams = {};
queryParams.addAll(convertParametersForCollectionFormat("", "Type", type));
queryParams.addAll(convertParametersForCollectionFormat("", "Text", text));
if (twoDDisplayText != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "TwoDDisplayText", twoDDisplayText));
}
if (textLocation != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "TextLocation", textLocation));
}
if (textAlignment != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "TextAlignment", textAlignment));
}
if (textColor != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "TextColor", textColor));
}
if (fontSizeMode != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "FontSizeMode", fontSizeMode));
}
if (noWrap != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "NoWrap", noWrap));
}
if (resolution != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "Resolution", resolution));
}
if (resolutionX != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "ResolutionX", resolutionX));
}
if (resolutionY != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "ResolutionY", resolutionY));
}
if (dimensionX != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "DimensionX", dimensionX));
}
if (textSpace != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "TextSpace", textSpace));
}
if (units != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "Units", units));
}
if (sizeMode != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "SizeMode", sizeMode));
}
if (barHeight != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "BarHeight", barHeight));
}
if (imageHeight != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "ImageHeight", imageHeight));
}
if (imageWidth != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "ImageWidth", imageWidth));
}
if (rotationAngle != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "RotationAngle", rotationAngle));
}
if (backColor != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "BackColor", backColor));
}
if (barColor != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "BarColor", barColor));
}
if (borderColor != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "BorderColor", borderColor));
}
if (borderWidth != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "BorderWidth", borderWidth));
}
if (borderDashStyle != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "BorderDashStyle", borderDashStyle));
}
if (borderVisible != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "BorderVisible", borderVisible));
}
if (enableChecksum != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "EnableChecksum", enableChecksum));
}
if (enableEscape != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "EnableEscape", enableEscape));
}
if (filledBars != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "FilledBars", filledBars));
}
if (alwaysShowChecksum != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AlwaysShowChecksum", alwaysShowChecksum));
}
if (wideNarrowRatio != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "WideNarrowRatio", wideNarrowRatio));
}
if (validateText != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "ValidateText", validateText));
}
if (supplementData != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "SupplementData", supplementData));
}
if (supplementSpace != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "SupplementSpace", supplementSpace));
}
if (barWidthReduction != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "BarWidthReduction", barWidthReduction));
}
if (useAntiAlias != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "UseAntiAlias", useAntiAlias));
}
if (format != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "format", format));
}
final List<String> contentTypes = ["application/json"];
final String contentType =
contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
final List<String> authNames = ["JWT"];
final response = await apiClient.invokeAPI(requestPath, 'GET', queryParams,
postBody, headerParams, formParams, contentType, authNames);
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else {
return response.bodyBytes;
}
}