@@ -29,7 +29,9 @@ Here are some [printers tested with this library](printers.md). Please add your
...
@@ -29,7 +29,9 @@ Here are some [printers tested with this library](printers.md). Please add your
**Note**: Your printer may not support some of the presented features (especially for underline styles, partial/full paper cutting, reverse feed, ...).
**Note**: Your printer may not support some of the presented features (especially for underline styles, partial/full paper cutting, reverse feed, ...).
## Getting started (Generate a ticket)
## Getting started: Generate a Ticket
### Simple ticket:
```dart
```dart
TickettestTicket(){
TickettestTicket(){
finalTicketticket=Ticket(PaperSize.mm80);
finalTicketticket=Ticket(PaperSize.mm80);
...
@@ -61,7 +63,8 @@ Ticket testTicket() {
...
@@ -61,7 +63,8 @@ Ticket testTicket() {
returnticket;
returnticket;
}
}
```
```
Print a table row:
### Print a table row:
```dart
```dart
ticket.row([
ticket.row([
...
@@ -83,7 +86,7 @@ ticket.row([
...
@@ -83,7 +86,7 @@ ticket.row([
]);
]);
```
```
Print an image:
### Print an image:
```dart
```dart
import'dart:io';
import'dart:io';
...
@@ -97,13 +100,38 @@ ticket.image(image);
...
@@ -97,13 +100,38 @@ ticket.image(image);
ticket.imageRaster(image);
ticket.imageRaster(image);
```
```
Print a barcode:
### Print a barcode:
```dart
```dart
finalList<int>barData=[1,2,3,4,5,6,7,8,9,0,4];
finalList<int>barData=[1,2,3,4,5,6,7,8,9,0,4];
ticket.barcode(Barcode.upcA(barData));
ticket.barcode(Barcode.upcA(barData));
```
```
## Getting Started (WiFi printer)
### Print a QR Code:
To print a QR Code, add [qr_flutter](https://pub.dev/packages/qr_flutter) and [path_provider](https://pub.dev/packages/path_provider) as a dependency in your `pubspec.yaml` file.