getConnectionState method
Returns the current connection state for printer.
Implementation
@override
Future<ConnectionState> getConnectionState(BluetoothPrinter printer) async {
final index = await methodChannel.invokeMethod<int>(
'getConnectionState',
<String, Object?>{'printerId': printer.id},
);
return ConnectionState.values[(index ?? 0).clamp(
0,
ConnectionState.values.length - 1,
)];
}