connectToWifiPrinter method
connectToWifiPrinter(String) attempts to connect to a printer via Wi-Fi whose name is passed into the method. This is asynchronous and returns a Boolean value afterwards with the result of the connection (i.e. success or failure).
Implementation
@override
Future<bool?> connectToWifiPrinter(String? printer) async {
var sendMap = <String, dynamic>{"printerName": printer};
bool? connected =
await methodChannel.invokeMethod<bool>('connectToWifiPrinter', sendMap);
return connected;
}