Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esc_pos_print_plus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
esc_pos_print_plus
Commits
5ef85c91
Commit
5ef85c91
authored
Nov 12, 2020
by
andrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`NetworkPrinter`: added `paperSize`, `profile`, `host`, `port` getters
parent
bec0754c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
CHANGELOG.md
CHANGELOG.md
+4
-0
network_printer.dart
lib/src/network_printer.dart
+12
-2
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
CHANGELOG.md
View file @
5ef85c91
## [4.0.1]
-
`NetworkPrinter`
: added
`paperSize`
,
`profile`
,
`host`
,
`port`
getters
## [4.0.0]
## [4.0.0]
-
New code generation concept: instead of generating the whole ticket, commands sent separately for each command
-
New code generation concept: instead of generating the whole ticket, commands sent separately for each command
...
...
lib/src/network_printer.dart
View file @
5ef85c91
...
@@ -14,17 +14,27 @@ import './enums.dart';
...
@@ -14,17 +14,27 @@ import './enums.dart';
/// Network Printer
/// Network Printer
class
NetworkPrinter
{
class
NetworkPrinter
{
NetworkPrinter
(
PaperSize
paperSize
,
CapabilityProfile
profile
,
NetworkPrinter
(
this
.
_paperSize
,
this
.
_profile
,
{
int
spaceBetweenRows
=
5
})
{
{
int
spaceBetweenRows
=
5
})
{
_generator
=
_generator
=
Generator
(
paperSize
,
profile
,
spaceBetweenRows:
spaceBetweenRows
);
Generator
(
paperSize
,
profile
,
spaceBetweenRows:
spaceBetweenRows
);
}
}
final
PaperSize
_paperSize
;
final
CapabilityProfile
_profile
;
String
_host
;
int
_port
;
Generator
_generator
;
Generator
_generator
;
Socket
_socket
;
Socket
_socket
;
int
get
port
=>
_port
;
String
get
host
=>
_host
;
PaperSize
get
paperSize
=>
_paperSize
;
CapabilityProfile
get
profile
=>
_profile
;
Future
<
PosPrintResult
>
connect
(
String
host
,
Future
<
PosPrintResult
>
connect
(
String
host
,
{
int
port
=
91000
,
Duration
timeout
=
const
Duration
(
seconds:
5
)})
async
{
{
int
port
=
91000
,
Duration
timeout
=
const
Duration
(
seconds:
5
)})
async
{
_host
=
host
;
_port
=
port
;
try
{
try
{
_socket
=
await
Socket
.
connect
(
'192.168.0.101'
,
port
,
timeout:
timeout
);
_socket
=
await
Socket
.
connect
(
'192.168.0.101'
,
port
,
timeout:
timeout
);
_socket
.
add
(
_generator
.
reset
());
_socket
.
add
(
_generator
.
reset
());
...
...
pubspec.yaml
View file @
5ef85c91
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.
0
version
:
4.0.
1
homepage
:
https://github.com/andrey-ushakov/esc_pos_printer
homepage
:
https://github.com/andrey-ushakov/esc_pos_printer
environment
:
environment
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment