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
315e90c1
Commit
315e90c1
authored
Jun 14, 2019
by
Andrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init styles object.
parent
de76a7e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
printer.dart
lib/src/printer.dart
+7
-5
No files found.
lib/src/printer.dart
View file @
315e90c1
...
...
@@ -8,9 +8,7 @@
import
'dart:io'
;
import
'dart:typed_data'
;
// import 'package:esc_pos_printer/esc_pos_printer.dart';
import
'package:hex/hex.dart'
;
import
'commands.dart'
;
import
'enums.dart'
;
import
'exceptions.dart'
;
...
...
@@ -49,7 +47,7 @@ class Printer {
/// [colInd] range: 0..11
void
_print
(
String
text
,
{
PosStyles
styles
,
PosStyles
styles
=
const
PosStyles
()
,
int
colInd
=
0
,
int
linesAfter
=
0
,
})
{
...
...
@@ -83,7 +81,11 @@ class Printer {
}
/// Prints one line of styled text
void
println
(
String
text
,
{
PosStyles
styles
,
int
linesAfter
=
0
})
{
void
println
(
String
text
,
{
PosStyles
styles
=
const
PosStyles
(),
int
linesAfter
=
0
,
})
{
_print
(
text
,
styles:
styles
,
linesAfter:
linesAfter
);
_socket
.
writeln
();
emptyLines
(
linesAfter
);
...
...
@@ -103,7 +105,7 @@ class Printer {
for
(
int
i
=
0
;
i
<
cols
.
length
;
++
i
)
{
final
colInd
=
cols
.
sublist
(
0
,
i
).
fold
(
0
,
(
int
sum
,
col
)
=>
sum
+
col
.
width
);
_print
(
cols
[
i
].
text
,
colInd:
colInd
);
_print
(
cols
[
i
].
text
,
styles:
cols
[
i
].
styles
,
colInd:
colInd
);
}
_socket
.
writeln
();
...
...
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