PrintItem class

A single drawable element on a print label.

Constructors

PrintItem({required PrintItemType type, required double x, required double y, required double width, required double height, String? content, int? fontSize, int fontStyle = FontStyle.normal, String? fontName, bool antiColor = false, Uint8List? imageBytes})
const
PrintItem.barcode({required double x, required double y, required double width, required double height, required String content, bool antiColor = false})
Convenience constructor for barcode items.
const
PrintItem.image({required double x, required double y, required double width, required double height, required Uint8List imageBytes, bool antiColor = false})
Convenience constructor for image items.
const
PrintItem.qrCode({required double x, required double y, required double width, required double height, required String content, bool antiColor = false})
Convenience constructor for QR code items.
const
PrintItem.text({required double x, required double y, required double width, required double height, required String content, int? fontSize, int fontStyle = FontStyle.normal, String? fontName, bool antiColor = false})
Convenience constructor for text items.
const

Properties

antiColor bool
Whether to invert colors.
final
content String?
Text content (for PrintItemType.text, PrintItemType.barcode, PrintItemType.qrCode).
final
fontName String?
Font name. Defaults to platform default.
final
fontSize int?
Font size in mm (for text type).
final
fontStyle int
Font style flags (see FontStyle).
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height in mm.
final
imageBytes Uint8List?
Image bytes in PNG format (for PrintItemType.image).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type PrintItemType
Content type.
final
width double
Width in mm.
final
x double
X coordinate in mm.
final
y double
Y coordinate in mm.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited