pickPrinter method

  1. @override
Future<Printer?> pickPrinter(
  1. Rect bounds
)
override

Opens the native printer picker interface, and returns the URL of the selected printer.

Implementation

@override
Future<Printer?> pickPrinter(Rect bounds) async {
  final params = <String, dynamic>{
    'x': bounds.left,
    'y': bounds.top,
    'w': bounds.width,
    'h': bounds.height,
  };
  final printer = await _channel.invokeMethod<Map<dynamic, dynamic>>(
    'pickPrinter',
    params,
  );
  if (printer == null) {
    return null;
  }
  return Printer.fromMap(printer);
}