### Generate Barcode Drawing Operations Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/make.html Use the make method to generate a stream of drawing operations for a barcode. This example iterates through the operations and prints them. ```dart for (var op in Barcode.code39().make('HELLO', width: 200, height: 300)) { print(op); } ``` -------------------------------- ### Create a Telepen Barcode Instance Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/telepen.html Use this static method to get a Telepen barcode object. This method returns a const instance. ```dart static Barcode telepen() => const BarcodeTelepen(); ``` -------------------------------- ### Code39 Static Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/code39.html This static method creates a Code 39 barcode instance. The `drawSpacers` parameter controls the inclusion of start and stop delimiters. ```dart static Barcode code39({bool drawSpacers = true}) => BarcodeCode39(drawSpacers); ``` -------------------------------- ### make method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/make.html Main method to produce the barcode graphic description. Returns a stream of drawing operations required to properly display the barcode as a UTF-8 string. ```APIDOC ## make method ### Description Main method to produce the barcode graphic description. Returns a stream of drawing operations required to properly display the barcode as a UTF-8 string. ### Method Signature `Iterable make(String data, {required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding})` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **data** (String) - The data to encode in the barcode. * **width** (double) - Required - The desired width of the barcode. * **height** (double) - Required - The desired height of the barcode. * **drawText** (bool) - Optional - Whether to draw the text below the barcode. Defaults to false. * **fontHeight** (double?) - Optional - The height of the font for the text. * **textPadding** (double?) - Optional - The padding around the text. ### Usage Example ```dart for (var op in Barcode.code39().make('HELLO', width: 200, height: 300)) { print(op); } ``` ### Response Returns an `Iterable` which represents drawing operations. ``` -------------------------------- ### Get Minimum Barcode Length Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/minLength.html Retrieves the minimum number of characters that the barcode can encode. This is a read-only property. ```dart int get minLength => 1; ``` -------------------------------- ### right property Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeElement/right.html Gets the right position of the barcode element. This is a calculated property based on the element's left position and width. ```APIDOC ## right property ### Description Gets the right position of this element. This is a calculated property. ### Getter `double get right` ### Returns A double representing the right edge position of the element. ### Implementation ```dart double get right => left + width; ``` ``` -------------------------------- ### makeBytes Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeEan/makeBytes.html This snippet shows the full implementation of the makeBytes method. It asserts valid input dimensions, calculates layout parameters, converts the input Uint8List to a string, and then generates BarcodeBar elements based on the converted data. It also handles optional text drawing. ```dart @override Iterable makeBytes( Uint8List data, { required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding, }) sync* { assert(width > 0); assert(height > 0); assert(!drawText || fontHeight != null); fontHeight ??= 0; textPadding ??= defaultTextPadding; final text = utf8.decoder.convert(data); final bits = convert(text).toList(); if (bits.isEmpty) { return; } final top = marginTop(drawText, width, height, fontHeight, textPadding); final left = marginLeft(drawText, width, height, fontHeight, textPadding); final right = marginRight(drawText, width, height, fontHeight, textPadding); final lineWidth = (width - left - right) / bits.length; var color = bits.first; var count = 1; for (var i = 1; i < bits.length; i++) { if (color == bits[i]) { count++; continue; } yield BarcodeBar( left: left + (i - count) * lineWidth, top: top, width: count * lineWidth, height: getHeight( i - count, count, width, height - top, fontHeight, textPadding, drawText, ), black: color, ); color = bits[i]; count = 1; } final l = bits.length; yield BarcodeBar( left: left + (l - count) * lineWidth, top: top, width: count * lineWidth, height: getHeight( l - count, count, width, height - top, fontHeight, textPadding, drawText, ), black: color, ); if (drawText) { yield* makeText(text, width, height, fontHeight, textPadding, lineWidth); } } ``` -------------------------------- ### program() Source: https://pub.dev/documentation/barcode/latest/barcode/DataMatrixEncoder-class.html Adds a Reader Programming sequence to the DataMatrix message. ```APIDOC ## program() ### Description Adds a Reader Programming sequence to the DataMatrix message. ### Method program ### Parameters None ``` -------------------------------- ### ean8 static method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/ean8.html Generates an EAN-8 barcode. The `drawSpacers` parameter controls whether to draw start and end characters in the margins. ```APIDOC ## ean8 static method ### Description Generates an EAN-8 barcode. The `drawSpacers` parameter controls whether to draw start and end characters in the margins. ### Method static ### Parameters #### Named Parameters - **drawSpacers** (bool) - Optional - Draws the start '<' and end '>' characters in the left and right margins. ### Implementation ```dart static Barcode ean8({bool drawSpacers = false}) => BarcodeEan8(drawSpacers); ``` ``` -------------------------------- ### upcE static method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/upcE.html Generates a UPC-E barcode. Optionally falls back to UPC-A if the code cannot be converted to UPC-E. ```APIDOC ## upcE static method ### Description Generates a UPC-E barcode. If the `fallback` parameter is set to true, it will attempt to convert the code to UPC-A if it cannot be represented as UPC-E. ### Method static ### Parameters #### Named Parameters - **fallback** (bool) - Optional - If true, fall back to UPC-A if the code cannot be converted to UPC-E. ### Implementation ```dart static Barcode upcE({bool fallback = false}) => BarcodeUpcE(fallback); ``` ``` -------------------------------- ### Get right position of BarcodeElement Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeElement/right.html Retrieves the rightmost coordinate of the barcode element. This is calculated by adding the element's width to its left position. ```dart double get right => left + width; ``` -------------------------------- ### MeCard.wifi Factory Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard/MeCard.wifi.html This is the implementation of the MeCard.wifi factory constructor. It takes SSID, type, password, and hidden status to create a WIFI MeCard. ```dart factory MeCard.wifi({ required String ssid, String type = 'WPA', String? password, bool hidden = false, }) { final fields = []; fields.add(MeTuple('S', ssid)); if (password != null) { fields.add(MeTuple('T', type)); fields.add(MeTuple('P', password)); } if (hidden == true) { fields.add(MeTuple.bool('H', true)); } return MeCard(type: 'WIFI', fields: fields); } ``` -------------------------------- ### MeTuple Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/MeTuple/MeTuple.html Creates a new MeTuple instance with a key and a value. Use this to initialize a tuple with specific data. ```dart const MeTuple(this.key, this.val); ``` -------------------------------- ### Get Bottom Position of Barcode Element Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeElement/bottom.html Calculates the bottom position of the barcode element. This is derived from the element's top position and its height. ```dart double get bottom => top + height; ``` -------------------------------- ### Verify Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/verify.html This snippet shows the implementation of the `verify` method, which converts a string to bytes and calls `verifyBytes`. ```dart void verify(String data) => verifyBytes(utf8.encoder.convert(data)); ``` -------------------------------- ### Get Barcode Max Length Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/maxLength.html Retrieves the maximum number of characters that can be encoded by this Barcode. This implementation returns a constant value representing an infinite maximum length. ```dart int get maxLength => _infiniteMaxLength; ``` -------------------------------- ### MeTuple Constructors Source: https://pub.dev/documentation/barcode/latest/barcode/MeTuple-class.html Provides constructors for creating MeTuple objects with different value types. ```APIDOC ## MeTuple Constructors ### MeTuple(String key, String val) * **Description**: Create a tuple with a string key and string value. * **Constructor**: `const MeTuple(String key, String val)` ### MeTuple.bool(String key, bool val) * **Description**: Create a tuple with a string key and a boolean value. * **Constructor**: `factory MeTuple.bool(String key, bool val)` ### MeTuple.date(String key, DateTime val) * **Description**: Create a tuple with a string key and a DateTime value. * **Constructor**: `factory MeTuple.date(String key, DateTime val)` ### MeTuple.sub(String key, Iterable val) * **Description**: Create a tuple with a string key and an iterable of strings, stored as a comma-separated value. * **Constructor**: `factory MeTuple.sub(String key, Iterable val)` ``` -------------------------------- ### Barcode.fromType Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/Barcode.fromType.html Creates a specific Barcode instance based on the BarcodeType. This constructor uses only the default barcode settings. For more fine-grained control, use the static methods like Barcode.code39(), Barcode.code128(), etc. ```APIDOC ## Barcode.fromType(BarcodeType type) ### Description Creates a specific Barcode instance based on the provided BarcodeType using default settings. ### Parameters #### Path Parameters - **type** (BarcodeType) - Required - The type of barcode to create. ### Notes For finer-grained control over barcode settings, it is recommended to use the static methods such as `Barcode.code39()`, `Barcode.code128()`, and others, instead of this factory constructor. ``` -------------------------------- ### Static Barcode Creation Methods Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode-class.html Factory methods to create specific Barcode instances for various barcode types. ```APIDOC ## Static Barcode Creation Methods ### aztec({int minECCPercent = BarcodeAztec.defaultEcPercent, int userSpecifiedLayers = BarcodeAztec.defaultLayers}) - **Description**: Creates an Aztec barcode instance. - **Parameters**: - **minECCPercent** (`int`, optional): Minimum error correction percentage. - **userSpecifiedLayers** (`int`, optional): User-specified number of layers. - **Returns**: `Barcode` ### codabar({BarcodeCodabarStartStop start = BarcodeCodabarStartStop.A, BarcodeCodabarStartStop stop = BarcodeCodabarStartStop.B, bool printStartStop = false, bool explicitStartStop = false}) - **Description**: Creates a Codabar barcode instance. - **Parameters**: - **start** (`BarcodeCodabarStartStop`, optional): The start character. - **stop** (`BarcodeCodabarStartStop`, optional): The stop character. - **printStartStop** (`bool`, optional): Whether to print start/stop characters. - **explicitStartStop** (`bool`, optional): Whether to use explicit start/stop characters. - **Returns**: `Barcode` ### code128({bool useCode128A = true, bool useCode128B = true, bool useCode128C = true, bool escapes = false}) - **Description**: Creates a Code128 barcode instance. - **Parameters**: - **useCode128A** (`bool`, optional): Whether to use Code 128 A encoding. - **useCode128B** (`bool`, optional): Whether to use Code 128 B encoding. - **useCode128C** (`bool`, optional): Whether to use Code 128 C encoding. - **escapes** (`bool`, optional): Whether to enable escape characters. - **Returns**: `Barcode` ### code39({bool drawSpacers = true}) - **Description**: Creates a Code 39 barcode instance. - **Parameters**: - **drawSpacers** (`bool`, optional): Whether to draw spacers. - **Returns**: `Barcode` ### code93() - **Description**: Creates a Code 93 barcode instance. - **Returns**: `Barcode` ### dataMatrix() - **Description**: Creates a Data Matrix barcode instance. - **Returns**: `Barcode` ### ean13({bool drawEndChar = false}) - **Description**: Creates an EAN 13 barcode instance. - **Parameters**: - **drawEndChar** (`bool`, optional): Whether to draw the end character. - **Returns**: `Barcode` ### ean2() - **Description**: Creates an EAN 2 barcode instance. - **Returns**: `Barcode` ### ean5() - **Description**: Creates an EAN 5 barcode instance. - **Returns**: `Barcode` ### ean8({bool drawSpacers = false}) - **Description**: Creates an EAN 8 barcode instance. - **Parameters**: - **drawSpacers** (`bool`, optional): Whether to draw spacers. - **Returns**: `Barcode` ### gs128({bool useCode128A = true, bool useCode128B = true, bool useCode128C = true, bool escapes = false, bool addSpaceAfterParenthesis = true, bool keepParenthesis = false}) - **Description**: Creates a GS1-128 barcode instance. - **Parameters**: - **useCode128A** (`bool`, optional): Whether to use Code 128 A encoding. - **useCode128B** (`bool`, optional): Whether to use Code 128 B encoding. - **useCode128C** (`bool`, optional): Whether to use Code 128 C encoding. - **escapes** (`bool`, optional): Whether to enable escape characters. - **addSpaceAfterParenthesis** (`bool`, optional): Whether to add a space after parenthesis. - **keepParenthesis** (`bool`, optional): Whether to keep parenthesis. - **Returns**: `Barcode` ### isbn({bool drawEndChar = false, bool drawIsbn = true}) - **Description**: Creates an ISBN barcode instance. - **Parameters**: - **drawEndChar** (`bool`, optional): Whether to draw the end character. - **drawIsbn** (`bool`, optional): Whether to draw the ISBN identifier. - **Returns**: `Barcode` ### itf({bool addChecksum = false, bool zeroPrepend = false, bool drawBorder = false, double? borderWidth, double? quietWidth, int? fixedLength}) - **Description**: Creates a 2 of 5 barcode instance. - **Parameters**: - **addChecksum** (`bool`, optional): Whether to add a checksum. - **zeroPrepend** (`bool`, optional): Whether to prepend zeros. - **drawBorder** (`bool`, optional): Whether to draw a border. - **borderWidth** (`double?`, optional): The width of the border. - **quietWidth** (`double?`, optional): The width of the quiet zone. - **fixedLength** (`int?`, optional): The fixed length of the barcode data. - **Returns**: `Barcode` ### itf14({bool drawBorder = true, double? borderWidth, double? quietWidth}) - **Description**: Creates an ITF-14 barcode instance. - **Parameters**: - **drawBorder** (`bool`, optional): Whether to draw a border. Defaults to `true`. - **borderWidth** (`double?`, optional): The width of the border. - **quietWidth** (`double?`, optional): The width of the quiet zone. - **Returns**: `Barcode` ### itf16({bool drawBorder = true, double? borderWidth, double? quietWidth}) - **Description**: Creates an ITF-16 barcode instance. - **Parameters**: - **drawBorder** (`bool`, optional): Whether to draw a border. Defaults to `true`. - **borderWidth** (`double?`, optional): The width of the border. - **quietWidth** (`double?`, optional): The width of the quiet zone. - **Returns**: `Barcode` ### pdf417({Pdf417SecurityLevel securityLevel = Pdf417SecurityLevel.level2, double moduleHeight = 2.0, double preferredRatio = 3.0}) - **Description**: Creates a PDF417 barcode instance. - **Parameters**: - **securityLevel** (`Pdf417SecurityLevel`, optional): The error correction security level. - **moduleHeight** (`double`, optional): The height of a module. - **preferredRatio** (`double`, optional): The preferred aspect ratio. - **Returns**: `Barcode` ### postnet() - **Description**: Creates a POSTNET barcode instance. - **Returns**: `Barcode` ### qrCode({int? typeNumber, BarcodeQRCorrectionLevel errorCorrectLevel = BarcodeQRCorrectionLevel.low}) - **Description**: Creates a QR Code instance. - **Parameters**: - **typeNumber** (`int?`, optional): The QR code version number. - **errorCorrectLevel** (`BarcodeQRCorrectionLevel`, optional): The error correction level. - **Returns**: `Barcode` ### rm4scc() - **Description**: Creates an RM4SCC barcode instance. - **Returns**: `Barcode` ### telepen() - **Description**: Creates a Telepen barcode instance. - **Returns**: `Barcode` ### upcA() - **Description**: Creates a UPC-A barcode instance. - **Returns**: `Barcode` ### upcE({bool fallback = false}) - **Description**: Creates a UPC-E barcode instance. - **Parameters**: - **fallback** (`bool`, optional): Whether to fallback to UPC-A if UPC-E is not suitable. - **Returns**: `Barcode` ``` -------------------------------- ### Generate EAN-8 Barcode Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/ean8.html Use the static `ean8` method to create an EAN-8 barcode instance. Set `drawSpacers` to true to include start and end spacer characters. ```dart static Barcode ean8({bool drawSpacers = false}) => BarcodeEan8(drawSpacers); ``` -------------------------------- ### Barcode Make Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/make.html The implementation of the make method, which converts the input string data to bytes and calls the makeBytes method. ```dart Iterable make( String data, { required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding, }) => makeBytes( utf8.encoder.convert(data), width: width, height: height, drawText: drawText, fontHeight: fontHeight, textPadding: textPadding, ); ``` -------------------------------- ### Barcode Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/Barcode.html This is the implementation of the Barcode constructor. ```javascript const Barcode(); ``` -------------------------------- ### MeTuple.sub Factory Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/MeTuple/MeTuple.sub.html This factory constructor takes a key and an iterable of strings, formats them into a comma-separated string with escaped commas, and returns a MeTuple instance. It handles trailing commas by removing them before creating the final tuple. ```dart factory MeTuple.sub(String key, Iterable val) { final result = StringBuffer(); for (final v in val) { result.write(v.replaceAll(',', r'\,')); result.write(','); } final data = result.toString(); var p = data.length - 1; while (data.codeUnitAt(p) == 0x2c) { p--; } return MeTuple(key, data.substring(0, p + 1)); } ``` -------------------------------- ### makeBytes Method Signature Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeEan/makeBytes.html Generates the barcode graphic description from a Uint8List data. This method is an override and provides similar functionality to the 'make' method but operates on byte arrays. ```APIDOC ## makeBytes Method ### Description Generates the barcode graphic description like `make` but takes a `Uint8List` data. ### Method Signature ```dart Iterable makeBytes( Uint8List data, { required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding, } ) override ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **data** (Uint8List) - The raw byte data to encode into a barcode. * **width** (double) - Required. The desired width of the barcode graphic. * **height** (double) - Required. The desired height of the barcode graphic. * **drawText** (bool) - Optional. If true, the human-readable text will be drawn below the barcode. Defaults to false. * **fontHeight** (double?) - Optional. The height of the font to use if `drawText` is true. Must be provided if `drawText` is true. * **textPadding** (double?) - Optional. The padding around the text if `drawText` is true. Defaults to `defaultTextPadding`. ### Returns An `Iterable` representing the barcode graphic elements (bars and text). ### Example ```dart // Example usage (assuming BarcodeEan class and necessary imports) // final barcodeEan = BarcodeEan(); // final byteData = Uint8List.fromList([4, 0, 9, 5, 1, 2, 3, 4, 5, 6, 7]); // final barcodeElements = barcodeEan.makeBytes( // byteData, // width: 200.0, // height: 100.0, // drawText: true, // fontHeight: 14.0, // ); // for (var element in barcodeElements) { // // Process each BarcodeElement (e.g., draw it) // } ``` ``` -------------------------------- ### toString Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard/toString.html Returns the MeCard formatted content for this object as a string. ```APIDOC ## toString() ### Description Returns the MeCard formatted content for this object as a string. This method overrides the default toString behavior to provide a specific MeCard representation. ### Method Signature String toString() ### Return Value - String: The MeCard formatted string. ``` -------------------------------- ### BarcodeText Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeText/BarcodeText.html The actual implementation of the BarcodeText constructor, initializing its properties and calling the superclass constructor. ```dart const BarcodeText({ required double left, required double top, required double width, required double height, required this.text, required this.align, }) : super( left: left, top: top, width: width, height: height, ); ``` -------------------------------- ### qrCode static method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/qrCode.html Generates a QR code barcode. You can specify the QR code version and the error correction level. ```APIDOC ## qrCode static method ### Description Generates a QR code barcode. You can specify the QR code version and the error correction level. ### Method Signature `static Barcode qrCode({int? typeNumber, BarcodeQRCorrectionLevel errorCorrectLevel = BarcodeQRCorrectionLevel.low})` ### Parameters #### Optional Parameters - **typeNumber** (int?) - The QR code version number, ranging from 1 to 40. - **errorCorrectLevel** (BarcodeQRCorrectionLevel) - The QR Code Correction Level. Defaults to `BarcodeQRCorrectionLevel.low`. ### Returns - **Barcode** - An instance of a QR code barcode. ``` -------------------------------- ### MeCard Constructors Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard-class.html Provides constructors for creating different types of MeCard objects: a custom MeCard with fields, a contact MeCard with various contact details, and a Wi-Fi MeCard with network credentials. ```APIDOC ## Constructors ### MeCard() * **Description**: Create a custom MeCard. * **Parameters**: * `type` (String) - Optional - The type of MeCard, defaults to 'MECARD'. * `fields` (List) - Optional - A list of MeTuple objects representing the fields of the MeCard, defaults to an empty list. ### MeCard.contact() * **Description**: Create a contact MeCard. * **Parameters**: * `name` (String?) - Optional - The name of the contact. * `reading` (String?) - Optional - The reading of the name (e.g., phonetic). * `tel` (String?) - Optional - The primary phone number. * `tels` (List?) - Optional - A list of additional phone numbers. * `videophone` (String?) - Optional - The videophone number. * `email` (String?) - Optional - The primary email address. * `emails` (List?) - Optional - A list of additional email addresses. * `memo` (String?) - Optional - A memo or note for the contact. * `birthday` (DateTime?) - Optional - The birthday of the contact. * `address` (String?) - Optional - The address of the contact. * `url` (String?) - Optional - The primary URL associated with the contact. * `urls` (List?) - Optional - A list of additional URLs. * `nickname` (String?) - Optional - The nickname of the contact. ### MeCard.wifi() * **Description**: Create a WIFI MeCard. * **Parameters**: * `ssid` (String) - Required - The SSID of the Wi-Fi network. * `type` (String) - Optional - The type of Wi-Fi security (WEP or WPA), defaults to 'WPA'. * `password` (String?) - Optional - The password for the Wi-Fi network. * `hidden` (bool) - Optional - Indicates if the Wi-Fi network is hidden, defaults to false. ``` -------------------------------- ### toSvgBytes Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/toSvgBytes.html This is the core implementation of the toSvgBytes method. It takes raw barcode data and various optional parameters to customize the generated SVG output. It utilizes a helper function `makeBytes` to prepare the barcode recipe and then `_toSvg` to format it as an SVG string. ```dart @nonVirtual String toSvgBytes( Uint8List data, { double x = 0, double y = 0, double width = 200, double height = 80, bool drawText = true, String fontFamily = 'monospace', double? fontHeight, double? textPadding, int color = 0x000000, bool fullSvg = true, double baseline = .75, }) { fontHeight ??= height * 0.2; textPadding ??= height * 0.05; final recipe = makeBytes( data, width: width.toDouble(), height: height.toDouble(), drawText: drawText, fontHeight: fontHeight, textPadding: textPadding, ); return _toSvg(recipe, x, y, width, height, fontFamily, fontHeight, textPadding, color, fullSvg, baseline); } ``` -------------------------------- ### MeCard.contact Factory Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard/MeCard.contact.html Use this factory constructor to create a MeCard object representing a contact. You can provide various details such as name, reading, phone numbers, emails, address, URL, and more. ```APIDOC ## MeCard.contact Factory Constructor ### Description Creates a MeCard object for a contact with specified details. ### Parameters - **name** (String?) - Optional - The full name of the contact. - **reading** (String?) - Optional - The reading of the name (e.g., for pronunciation). - **tel** (String?) - Optional - A phone number for the contact. - **tels** (List?) - Optional - A list of phone numbers for the contact. - **videophone** (String?) - Optional - A video phone number for the contact. - **email** (String?) - Optional - An email address for the contact. - **emails** (List?) - Optional - A list of email addresses for the contact. - **memo** (String?) - Optional - A memo or note associated with the contact. - **birthday** (DateTime?) - Optional - The birthday of the contact. - **address** (String?) - Optional - The address of the contact. - **url** (String?) - Optional - A URL associated with the contact. - **urls** (List?) - Optional - A list of URLs associated with the contact. - **nickname** (String?) - Optional - The nickname of the contact. ### Implementation Notes This constructor takes various optional parameters and maps them to the appropriate MeCard fields (e.g., N for name, TEL for phone, EMAIL for email, BDAY for birthday). ``` -------------------------------- ### BarcodeEan() Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeEan-class.html Creates an instance of the EAN Barcode. This is the primary way to instantiate an EAN barcode object. ```APIDOC ## BarcodeEan() ### Description Create an EAN Barcode. ### Method Constructor ``` -------------------------------- ### Create POSTNET Barcode Instance Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/postnet.html Use this static method to create a const instance of the BarcodePostnet class. This is the standard way to obtain a POSTNET barcode object for use in the application. ```dart static Barcode postnet() => const BarcodePostnet(); ``` -------------------------------- ### BarcodeBar Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeBar-class.html Creates a BarcodeBar object, which represents a rectangle that can be drawn as either a black or white unit. This is fundamental for constructing barcode patterns. ```APIDOC ## BarcodeBar Constructor ### Description Creates a rectangle drawing operation to draw a white or black unit. ### Parameters * **left** (double) - Required - The x-coordinate of the left edge of the rectangle. * **top** (double) - Required - The y-coordinate of the top edge of the rectangle. * **width** (double) - Required - The width of the rectangle. * **height** (double) - Required - The height of the rectangle. * **black** (bool) - Required - Determines if the rectangle should be black (true) or white (false). ``` -------------------------------- ### Create a Data Matrix Barcode Instance Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/dataMatrix.html This static method creates a new instance of the DataMatrix barcode. Use this when you need a basic Data Matrix barcode object. ```dart static Barcode dataMatrix() => const BarcodeDataMatrix(); ``` -------------------------------- ### MeCard Methods Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard-class.html Provides methods for interacting with the MeCard object, including its string representation. ```APIDOC ## Methods ### toString() * **Description**: Return the MeCard formatted content for this object. * **Returns**: String * **Override**: true ``` -------------------------------- ### Codabar Static Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/codabar.html This static method creates and returns a BarcodeCodabar instance. Use it to configure Codabar barcodes with specific start/stop symbols and printing options. ```dart static Barcode codabar({ BarcodeCodabarStartStop start = BarcodeCodabarStartStop.A, BarcodeCodabarStartStop stop = BarcodeCodabarStartStop.B, bool printStartStop = false, bool explicitStartStop = false, }) => BarcodeCodabar(start, stop, printStartStop, explicitStartStop); ``` -------------------------------- ### makeBytes Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/makeBytes.html Generates a barcode graphic from raw byte data. This method is similar to `make` but accepts `Uint8List` as input. ```APIDOC ## makeBytes ### Description Generates a barcode graphic from raw byte data. This method is similar to `make` but accepts `Uint8List` as input. ### Method Abstract Method ### Signature ```dart Iterable makeBytes( Uint8List data, { required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding, } ) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **data** (Uint8List) - Required - The raw byte data to encode into a barcode. * **width** (double) - Required - The desired width of the barcode graphic. * **height** (double) - Required - The desired height of the barcode graphic. * **drawText** (bool) - Optional - If true, the barcode data will be drawn as text below the barcode. Defaults to false. * **fontHeight** (double?) - Optional - The height of the font to use if `drawText` is true. * **textPadding** (double?) - Optional - The padding around the text if `drawText` is true. ### Response #### Success Response Returns an `Iterable` representing the generated barcode graphic. ``` -------------------------------- ### BarcodeException Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeException-class.html Creates a new instance of the BarcodeException class with a specified error message. ```APIDOC ## BarcodeException(String message) ### Description Create a BarcodeException object with a given error message. ### Method `BarcodeException` (Constructor) ### Parameters #### Path Parameters - **message** (String) - Required - The error message describing the reason for the exception. ``` -------------------------------- ### BarcodeElement Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeElement/BarcodeElement.html Initializes a BarcodeElement with its position and dimensions. This is the primary way to create a BarcodeElement instance. ```dart const BarcodeElement({ required this.left, required this.top, required this.width, required this.height, }); ``` -------------------------------- ### Barcode Constructors Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode-class.html Abstract constructor for the Barcode class and a factory constructor to create specific Barcode instances based on BarcodeType. ```APIDOC ## Barcode() ### Description Abstract constructor for the Barcode class. ## Barcode.fromType(BarcodeType type) ### Description Create a specific Barcode instance based on the BarcodeType. This uses only the default barcode settings. For finer-grained usage, use the static methods. ### Factory `Barcode.fromType(BarcodeType type)` ``` -------------------------------- ### MeTuple.bool Factory Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/MeTuple/MeTuple.bool.html This factory constructor creates a MeTuple with a boolean value, converting the boolean to its string representation ('true' or 'false'). ```dart factory MeTuple.bool(String key, bool val) { return MeTuple(key, val ? 'true' : 'false'); } ``` -------------------------------- ### Generate SVG Barcode for Text Source: https://pub.dev/documentation/barcode/latest/index.html Generates an SVG representation of a DataMatrix barcode containing the text 'Hello World!'. The SVG is then saved to a file. Ensure the 'barcode' library is imported. ```dart // Create a DataMatrix barcode final dm = Barcode.dataMatrix(); // Generate a SVG with "Hello World!" final svg = bc.toSvg('Hello World!', width: 200, height: 200); // Save the image await File('barcode.svg').writeAsString(svg); ``` -------------------------------- ### verify method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/verify.html Checks if the provided data represents a valid barcode. Throws a BarcodeException if the data is invalid. ```APIDOC ## verify method ### Description Checks if the provided data represents a valid barcode. Throws a BarcodeException if the data is invalid. ### Method Signature `void verify(String data)` ### Parameters #### Path Parameters - **data** (String) - Required - The data to verify as a barcode. ``` -------------------------------- ### BarcodeBar Methods Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeBar-class.html Provides access to the methods of a BarcodeBar object. ```APIDOC ## BarcodeBar Methods ### Description Methods available for the BarcodeBar class. ### Methods * **noSuchMethod(Invocation invocation)** (dynamic) - Invoked when a nonexistent method or property is accessed. * **toString()** (String) - Returns a string representation of this object. ``` -------------------------------- ### makeText Method Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeEan/makeText.html Streams the text operations required to draw the barcode texts. This is automatically called by make. ```APIDOC ## makeText Method ### Description Streams the text operations required to draw the barcode texts. This is automatically called by make. ### Signature ```dart Iterable makeText( String data, double width, double height, double fontHeight, double textPadding, double lineWidth, ) ``` ### Parameters #### Path Parameters - **data** (String) - The data to be encoded in the barcode. - **width** (double) - The width of the barcode. - **height** (double) - The height of the barcode. - **fontHeight** (double) - The height of the font used for the text. - **textPadding** (double) - The padding around the text. - **lineWidth** (double) - The width of the barcode lines. ### Implementation ```dart @protected Iterable makeText( String data, double width, double height, double fontHeight, double textPadding, double lineWidth, ) sync* { yield BarcodeText( left: 0, top: height - fontHeight, width: width, height: fontHeight, text: data, align: BarcodeTextAlign.center, ); } ``` ``` -------------------------------- ### BarcodeException Methods Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeException-class.html Details the methods available on the BarcodeException class. ```APIDOC ## Methods ### `toString()` → String Returns a string representation of this object. Overrides the default toString method. ``` -------------------------------- ### MeCard Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard/MeCard.html Constructs a MeCard object. You can optionally specify the type and a list of fields. ```APIDOC ## MeCard Constructor ### Description Constructs a MeCard object. You can optionally specify the type and a list of fields. ### Method Constructor ### Parameters #### Named Parameters - **type** (String) - Optional - Defaults to 'MECARD'. Specifies the type of the MeCard. - **fields** (List) - Optional - Defaults to an empty list. A list of MeTuple objects representing the fields of the MeCard. ### Implementation ```dart const MeCard({this.type = 'MECARD', this.fields = const []}); ``` ``` -------------------------------- ### marginTop Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeEan/marginTop.html This is the implementation of the protected marginTop method. It returns 0, indicating no top margin is applied by default. ```dart @protected double marginTop( bool drawText, double width, double height, double fontHeight, double textPadding, ) => 0; ``` -------------------------------- ### Implement Program Method Source: https://pub.dev/documentation/barcode/latest/barcode/DataMatrixEncoder/program.html This C++ code implements the program method by adding a byte to the data. It's used for programming sequences in DataMatrix encoding. ```C++ void program() { _data.addByte(0xea); } ``` -------------------------------- ### DataMatrixEncoder Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/DataMatrixEncoder/DataMatrixEncoder.html Initializes a new instance of the DataMatrixEncoder class. This is the primary way to create an encoder object for generating Data Matrix barcodes. ```APIDOC ## DataMatrixEncoder() ### Description Constructs a new DataMatrixEncoder. ### Method new ### Endpoint N/A (Constructor) ### Parameters None ### Request Example ``` DataMatrixEncoder() ``` ### Response N/A (Constructor) ``` -------------------------------- ### BarcodeException Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeException/BarcodeException.html Creates a BarcodeException object with a message. ```APIDOC ## BarcodeException Constructor ### Description Creates a BarcodeException object with a message. ### Parameters #### Path Parameters - **message** (String) - Required - The error message for the exception. ### Implementation ```dart const BarcodeException(this.message); ``` ``` -------------------------------- ### makeBytes Abstract Method Signature Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/makeBytes.html Signature for the abstract makeBytes method. It takes raw byte data and dimensions, with optional parameters for text drawing. ```dart Iterable makeBytes( Uint8List data, { required double width, required double height, bool drawText = false, double? fontHeight, double? textPadding, }); ``` -------------------------------- ### QR Code Generation Method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/qrCode.html Use this static method to create a QR code barcode. It accepts an optional type number and error correction level. ```dart static Barcode qrCode( {int? typeNumber, BarcodeQRCorrectionLevel errorCorrectLevel = BarcodeQRCorrectionLevel.low}) => BarcodeQR(typeNumber, errorCorrectLevel); ``` -------------------------------- ### Barcode toSvg Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/toSvg.html Provides the implementation of the toSvg method, which prepares barcode data and calls a private helper method to generate the SVG. ```dart @nonVirtual String toSvg( String data, { double x = 0, double y = 0, double width = 200, double height = 80, bool drawText = true, String fontFamily = 'monospace', double? fontHeight, double? textPadding, int color = 0x000000, bool fullSvg = true, double baseline = .75, }) { fontHeight ??= height * 0.2; textPadding ??= height * 0.05; final recipe = make( data, width: width.toDouble(), height: height.toDouble(), drawText: drawText, fontHeight: fontHeight, textPadding: textPadding, ); return _toSvg(recipe, x, y, width, height, fontFamily, fontHeight, textPadding, color, fullSvg, baseline); } ``` -------------------------------- ### UPC-A Barcode Static Method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/upcA.html Provides a static method to create a UPC-A barcode instance. This is the standard way to instantiate a UPC-A barcode object. ```dart static Barcode upcA() => const BarcodeUpcA(); ``` -------------------------------- ### BarcodeText Constructor Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeText/BarcodeText.html The BarcodeText constructor initializes a drawing operation for barcode text. It requires positional arguments for its dimensions, the text content, and the alignment of the text. ```APIDOC ## BarcodeText Constructor ### Description Creates a new BarcodeText object, which represents a drawing operation for barcode text. ### Parameters - **left** (double) - Required - The x-coordinate of the top-left corner of the bounding box for the text. - **top** (double) - Required - The y-coordinate of the top-left corner of the bounding box for the text. - **width** (double) - Required - The width of the bounding box for the text. - **height** (double) - Required - The height of the bounding box for the text. - **text** (String) - Required - The text content to be displayed. - **align** (BarcodeTextAlign) - Required - The alignment of the text within its bounding box. ``` -------------------------------- ### MeTuple.date Factory Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/MeTuple/MeTuple.date.html This factory constructor formats a DateTime object into a 'YYYYMMDD' string format before creating a MeTuple. Use this when you need to store date values as strings in a tuple. ```dart factory MeTuple.date(String key, DateTime val) { final y = '${val.year}'.padLeft(4, '0'); final m = '${val.month}'.padLeft(2, '0'); final d = '${val.day}'.padLeft(2, '0'); return MeTuple(key, '$y$m$d'); } ``` -------------------------------- ### marginLeft Method Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeEan/marginLeft.html This is the default implementation of the marginLeft method. It returns 0, indicating no margin before the first bar. This method is marked as @protected. ```dart @protected double marginLeft( bool drawText, double width, double height, double fontHeight, double textPadding, ) => 0; ``` -------------------------------- ### ITF Barcode Static Method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/itf.html Use this static method to create an ITF barcode instance. It allows configuration of checksum, zero padding, border, and length. ```dart static Barcode itf({ bool addChecksum = false, bool zeroPrepend = false, bool drawBorder = false, double? borderWidth, double? quietWidth, int? fixedLength, }) => BarcodeItf(addChecksum, zeroPrepend, drawBorder, borderWidth, quietWidth, fixedLength); ``` -------------------------------- ### Static ISBN Barcode Factory Method Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/isbn.html Use this static method to create an ISBN barcode instance. It accepts boolean flags to control the drawing of the end character and the ISBN number text. ```dart static Barcode isbn({bool drawEndChar = false, bool drawIsbn = true}) => BarcodeIsbn(drawEndChar, drawIsbn); ``` -------------------------------- ### macro05() Source: https://pub.dev/documentation/barcode/latest/barcode/DataMatrixEncoder-class.html Adds a 05 Macro sequence to the DataMatrix message. ```APIDOC ## macro05() ### Description Adds a 05 Macro sequence to the DataMatrix message. ### Method macro05 ### Parameters None ``` -------------------------------- ### Create ITF-16 Barcode Instance Source: https://pub.dev/documentation/barcode/latest/barcode/Barcode/itf16.html Use this static method to create an instance of an ITF-16 barcode. You can optionally control border drawing, border width, and quiet zone width. ```dart static Barcode itf16({ bool drawBorder = true, double? borderWidth, double? quietWidth, }) => BarcodeItf16(drawBorder, borderWidth, quietWidth); ``` -------------------------------- ### BarcodeBar Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/BarcodeBar/BarcodeBar.html This is the Dart implementation of the BarcodeBar constructor. It initializes a rectangle drawing operation, specifying its position, dimensions, and color (black or white). ```dart const BarcodeBar({ required double left, required double top, required double width, required double height, required this.black, }) : super( left: left, top: top, width: width, height: height, ); ``` -------------------------------- ### MeCard Constructor Implementation Source: https://pub.dev/documentation/barcode/latest/barcode/MeCard/MeCard.html This is the Dart implementation of the MeCard constructor. It initializes the type to 'MECARD' and the fields to an empty list by default. ```dart const MeCard({this.type = 'MECARD', this.fields = const []}); ``` -------------------------------- ### MeTuple Properties Source: https://pub.dev/documentation/barcode/latest/barcode/MeTuple-class.html Exposes properties for accessing the key and value of a MeTuple object. ```APIDOC ## MeTuple Properties ### key * **Description**: The key of the tuple. * **Type**: String * **Final**: true ### val * **Description**: The value of the tuple. * **Type**: String * **Final**: true ```