PrinterSdk class abstract final

Entry point for the thermal printer SDK.

Call initialize once during app startup (before showing the settings screen) so the SDK can open its Hive box and start monitoring both connection types for automatic reconnection. For Bluetooth this is what restores the saved printer after a Flutter hot restart.

await PrinterSdk.initialize(
  primaryColor: const Color(0xFF0F766E),
  hiveBoxName: 'my_app_printer',
);
runApp(MyApp());

The call is optional and idempotent: each screen also initializes lazily, so forgetting it only costs a few milliseconds on first open.

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 Methods

dispose() → Future<void>
Releases streams and platform listeners held by the SDK.
initialize({Color? primaryColor, Color? primaryDarkColor, Color? accentColor, Color? bluetoothColor, Color? bluetoothDarkColor, Color? usbColor, Color? usbDarkColor, Color? successColor, Color? errorColor, Color? warningColor, Color? backgroundColor, Color? surfaceColor, String? hiveBoxName, String? appBarTitle, List<String>? paperSizes, String? defaultPaperSize, Duration? scanTimeout, Duration? connectTimeout, Duration? printTimeout, bool? autoReconnect, Duration? bluetoothHealthCheckInterval, List<Duration>? reconnectDelays, int? reconnectMaxAttempts, bool? showToasts, bool? showPrintLoader}) → Future<void>
Configures the SDK and opens its local storage.