Commit 2aab7ac1 authored by andrey's avatar andrey

added optional delayMs param

parent faf24390
## [4.0.3]
- Added optional delay param to `disconnect` method
## [4.0.2] ## [4.0.2]
- Fixed IP bug - Fixed IP bug
......
...@@ -44,8 +44,12 @@ class NetworkPrinter { ...@@ -44,8 +44,12 @@ class NetworkPrinter {
} }
} }
void disconnect() { /// [delayMs]: milliseconds to wait after destroying the socket
void disconnect({int delayMs}) async {
_socket.destroy(); _socket.destroy();
if (delayMs != null) {
await Future.delayed(Duration(milliseconds: delayMs), () => null);
}
} }
// ************************ Printer Commands ************************ // ************************ Printer Commands ************************
......
name: esc_pos_printer name: esc_pos_printer
description: The library allows to print receipts using an ESC/POS thermal WiFi printer. description: The library allows to print receipts using an ESC/POS thermal WiFi printer.
version: 4.0.2 version: 4.0.3
homepage: https://github.com/andrey-ushakov/esc_pos_printer homepage: https://github.com/andrey-ushakov/esc_pos_printer
environment: environment:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment