getPrinters method
Future<void>
getPrinters({
- Duration refreshDuration = const Duration(seconds: 2),
- List<
ConnectionType> connectionTypes = const [ConnectionType.BLE, ConnectionType.USB], - bool androidUsesFineLocation = false,
Get Printers from BT and USB
Implementation
Future<void> getPrinters({
Duration refreshDuration = const Duration(seconds: 2),
List<ConnectionType> connectionTypes = const [
ConnectionType.BLE,
ConnectionType.USB,
],
bool androidUsesFineLocation = false,
}) async {
if (connectionTypes.isEmpty) {
throw Exception('No connection type provided');
}
if (connectionTypes.contains(ConnectionType.USB)) {
await _getUSBPrinters(refreshDuration);
}
if (connectionTypes.contains(ConnectionType.BLE)) {
await _getBLEPrinters(androidUsesFineLocation);
}
}