SunmiTextStyle class
Represents the style configuration for text printing on a Sunmi printer.
The SunmiTextStyle
class provides a structured way to define the appearance
of text when printed. It includes options for font size, alignment, boldness,
underline, strikethrough, italicization, and reverse printing.
This class ensures that the configurations are valid and allows for flexible customization of text appearance to meet various printing requirements.
Example Usage
SunmiTextStyle style = SunmiTextStyle(
fontSize: 36,
align: SunmiPrintAlign.CENTER,
bold: true,
underline: true,
italic: false,
reverse: false,
);
Constructors
- SunmiTextStyle({int fontSize = 24, SunmiPrintAlign align = SunmiPrintAlign.LEFT, bool bold = false, bool underline = false, bool strikethrough = false, bool italic = false, bool reverse = false})
-
Factory constructor to create a SunmiTextStyle object with optional customizations.
factory
Properties
- align → SunmiPrintAlign?
-
The alignment of the text on the page or print area.
final
- bold → bool?
-
Indicates whether the text should be bold.
final
- fontSize → int?
-
The font size of the printed text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- italic → bool?
-
Indicates whether the text should be italicized.
final
- reverse → bool?
-
Indicates whether the text should be printed in reverse.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strikethrough → bool?
-
Indicates whether the text should have a strikethrough.
final
- underline → bool?
-
Indicates whether the text should have an underline.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Converts the SunmiTextStyle object to a map for serialization or transfer.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited