printCommand method
Future<bool>
printCommand({
- String address = "",
- String iniCommand = "",
- String cutterCommands = "",
- String img = "",
- String encode = "",
- bool isCut = false,
- bool isDisconnect = false,
- bool isDevicePOS = false,
- int timeout = 30,
- int width = 576,
override
Implementation
@override
Future<bool> printCommand({
String address = "",
String iniCommand = "",
String cutterCommands = "",
String img = "",
String encode = "",
bool isCut = false,
bool isDisconnect = false,
bool isDevicePOS = false,
int timeout = 30,
int width = 576,
}) async {
try {
final version = await methodChannel.invokeMethod('printCommand', {
'address': address,
'iniCommand': iniCommand,
'cutterCommands': cutterCommands,
'img': img,
'encode': encode,
'isCut': isCut,
'isDisconnect': isDisconnect,
'isDevicePOS': isDevicePOS,
'width': width,
}).timeout(
Duration(seconds: timeout), // กำหนด Timeout 30
onTimeout: () {
throw TimeoutException(
"Method disconnect timed out after 5 minutes.");
},
);
return version;
} on TimeoutException catch (e) {
return false;
} catch (e) {
return false;
}
}