PrinterSdkConfig class
Global configuration for the thermal printer SDK.
Everything here is intentionally mutable so host applications can brand the SDK without forking it. Call PrinterSdk.initialize once (or simply assign the fields directly) before showing the connection screen.
PrinterSdkConfig.primaryColor = const Color(0xFF0F766E);
PrinterSdkConfig.hiveBoxName = 'my_app_printer';
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- accentColor ↔ Color
-
Secondary accent color.
getter/setter pair
- appBarTitle ↔ String
-
App bar title of the connection screen.
getter/setter pair
- autoReconnect ↔ bool
-
Whether a disconnected USB or Bluetooth printer is reconnected
automatically.
getter/setter pair
- backgroundColor ↔ Color
-
Scaffold background.
getter/setter pair
- bluetoothColor ↔ Color
-
Accent of the Bluetooth connection type.
getter/setter pair
- bluetoothDarkColor ↔ Color
-
Darker shade of bluetoothColor, used for the hero gradient.
getter/setter pair
- bluetoothHealthCheckInterval ↔ Duration
-
How often a connected Bluetooth printer is verified.
getter/setter pair
- borderColor ↔ Color
-
Hairline border used on cards and inputs.
getter/setter pair
- borderRadius ↔ double
-
Default corner radius for cards, buttons and inputs.
getter/setter pair
- connectTimeout ↔ Duration
-
How long a connection attempt may take.
getter/setter pair
- defaultPaperSize ↔ String
-
Default paper size for new installations.
getter/setter pair
- errorColor ↔ Color
-
Color used for destructive states (errors, disconnect).
getter/setter pair
- hiveBoxName ↔ String
-
Hive box used for persisting the selected printer.
getter/setter pair
- loadingLabel ↔ String
-
Label shown inside the loading bubble, next to the printing animation.
getter/setter pair
- onPrimaryColor ↔ Color
-
Color of the text/icon rendered on top of primaryColor.
getter/setter pair
-
paperSizes
↔ List<
String> -
Supported paper sizes, in display order.
getter/setter pair
- primaryColor ↔ Color
-
Primary brand color. Used for buttons, toggles, gradients and accents.
getter/setter pair
- primaryDarkColor ↔ Color
-
Darker shade of primaryColor, used for gradient ends and pressed states.
getter/setter pair
- printTimeout ↔ Duration
-
How long a print job may take.
getter/setter pair
-
reconnectDelays
↔ List<
Duration> -
Delays between automatic reconnect attempts.
getter/setter pair
- reconnectMaxAttempts ↔ int
-
Maximum automatic reconnect attempts.
getter/setter pair
- scanTimeout ↔ Duration
-
How long a Bluetooth / USB discovery pass may take.
getter/setter pair
- screenPadding ↔ EdgeInsets
-
Outer padding used by the SDK screens.
getter/setter pair
- sectionSpacing ↔ double
-
Vertical gap between sections.
getter/setter pair
- showPrintLoader ↔ bool
-
Whether to show the animated loading bubble while printing.
getter/setter pair
- showToasts ↔ bool
-
Whether transient status changes are surfaced as toasts.
getter/setter pair
- successColor ↔ Color
-
Color used for successful states (connected, print sent).
getter/setter pair
- surfaceColor ↔ Color
-
Card / sheet background.
getter/setter pair
- textPrimaryColor ↔ Color
-
Primary text color.
getter/setter pair
- textSecondaryColor ↔ Color
-
Secondary / muted text color.
getter/setter pair
- usbColor ↔ Color
-
Accent of the USB connection type.
getter/setter pair
- usbDarkColor ↔ Color
-
Darker shade of usbColor, used for the hero gradient.
getter/setter pair
- warningColor ↔ Color
-
Color used for in-progress states (scanning, pairing).
getter/setter pair
Static Methods
-
is80mm(
String paperSize) → bool -
Returns paperSizes mapped to a
PaperSize-agnostic value. -
reset(
) → void - Resets every option to its factory default. Handy in tests.