evolute_printer_flutter
A Flutter plugin for Evolute handheld devices with integrated thermal printer.
Wraps the Evolute SDK AIDL service (com.evolute.sdkservice) to expose a clean, async Dart API for printing text, images, and QR codes on Evolute handheld hardware.
Platform Support
| Android | iOS |
|---|---|
| ✅ | ❌ (Evolute is Android-only hardware) |
Minimum Android SDK: 21
Prerequisites
This plugin requires the Evolute SDK JAR — a proprietary vendor library that cannot be distributed via pub.dev.
Because the JAR is referenced directly inside the plugin's native Kotlin code, it must live inside the package itself, not in your app. Follow these steps:
1. Clone the package repo:
git clone https://github.com/haelalhsen/evolute_printer_flutter.git
2. Place the JAR inside the cloned package:
evolute_printer_flutter/
└── android/
└── libs/
└── Evolute_SDK_Service_V02.09.00-01.aidl.jar ← here
3. Reference the package locally in your app's pubspec.yaml:
dependencies:
evolute_printer_flutter:
path: /path/to/evolute_printer_flutter
The package android/build.gradle is already configured to pick up the JAR automatically — no extra Gradle changes needed in your app.
Installation
Because the Evolute SDK JAR must be present inside the package (see Prerequisites above), use a local path dependency instead of pub.dev:
dependencies:
evolute_printer_flutter:
path: /path/to/evolute_printer_flutter
Quick Start
import 'package:evolute_printer_flutter/evolute_printer_flutter.dart';
final printer = EvolutePrinter();
// 1. Connect — bind to the Evolute SDK service (call in initState)
await printer.connect();
// 2. Set style and buffer text
await printer.setProperties(
alignment: PrintAlignment.center,
fontSize: PrintFontSize.normal,
);
await printer.appendText('\nHello World\n');
// 3. Print
await printer.startPrinting();
// 4. Feed paper
await printer.feedLines(5);
// 5. Disconnect (call in dispose)
await printer.disconnect();
API Reference
Lifecycle
await printer.connect(); // Bind to Evolute SDK printer service
await printer.disconnect(); // Unbind and release service
bool ready = printer.isConnected;
Buffer Management
// Set style — applies to all subsequent appendText() calls
await printer.setProperties(
alignment: PrintAlignment.center, // left | center | right
fontSize: PrintFontSize.normal, // see PrintFontSize enum
);
await printer.appendText('\nYour text'); // Buffer text (\n = line break)
await printer.flushBuffer(); // Clear buffer without printing
await printer.startPrinting(); // Send buffer to printer
Rich Content
// Print image from Flutter assets
final bytes = await rootBundle.load('assets/logo.png');
await printer.printImage(bytes.buffer.asUint8List());
// Print QR code
await printer.printQRCode(
data: 'https://example.com',
width: QRWidth.inch2,
alignment: PrintAlignment.center,
);
// Feed paper lines
await printer.feedLines(9);
Status
final PrinterStatus status = await printer.getStatus();
if (status.isSuccess) {
print('Printed OK');
} else {
print('Error: ${status.message}');
}
Error Handling
All methods throw PrinterException on failure:
try {
await printer.startPrinting();
} on PrinterException catch (e) {
print('Status : ${e.status}'); // PrinterStatus enum value
print('Message: ${e.message}'); // Human-readable description
}
Enums
PrintAlignment
| Value | Description |
|---|---|
left |
Left-align |
center |
Center |
right |
Right-align |
PrintFontSize
Verified against ESDKConstant.FontSize from SDK V02.09:
| Value | SDK Enum | Description |
|---|---|---|
normal |
Width_x_Height_1x1 |
Standard size |
doubleWidth |
Width_x_Height_2x1 |
Double width |
height2 |
Width_x_Height_1x2 |
Double height |
doubleSize |
Width_x_Height_2x2 |
Double width & height |
tripleWidth |
Width_x_Height_3x1 |
Triple width |
tripleSize |
Width_x_Height_3x3 |
Triple width & height |
quadSize |
Width_x_Height_4x4 |
Maximum size |
| (+ 9 more combinations) |
PrinterStatus
| Value | SDK Code | Meaning |
|---|---|---|
success |
0 | Print completed |
paperOut |
-51 | Paper tray empty |
lowPower |
-52 | Battery critically low |
busy |
-53 | Printer busy |
failure |
-54 | Hardware failure |
printLimitExceeded |
-55 | Print limit reached |
noResponse |
-56 | Not responding |
imageSizeNotSupported |
-57 | Image too large |
aborted |
-5 | Job aborted |
QRWidth
| Value | Description |
|---|---|
inch1 |
1-inch QR code |
inch2 |
2-inch QR code (recommended, max for SDK V02.09) |
Full Ticket Example
Future<void> printValetTicket({
required String plateNumber,
required String ticketNumber,
required String inTime,
}) async {
// Header
await printer.setProperties(alignment: PrintAlignment.center);
await printer.appendText('\nValet Parking Ticket No:');
await printer.startPrinting();
// Logo
final bytes = await rootBundle.load('assets/logo.png');
await printer.printImage(bytes.buffer.asUint8List());
// Ticket details
await printer.flushBuffer();
await printer.setProperties(alignment: PrintAlignment.center);
await printer.appendText('\n$ticketNumber');
await printer.appendText('\n\nLocation: EMAAR BUSINESS PARK');
await printer.startPrinting();
// Vehicle info
await printer.flushBuffer();
await printer.setProperties(alignment: PrintAlignment.left);
await printer.appendText('\nIN TIME : $inTime');
await printer.appendText('\nPLATE No: $plateNumber');
await printer.startPrinting();
// Paper feed & status check
await printer.feedLines(9);
final status = await printer.getStatus();
if (status.isError) {
throw PrinterException(status: status, message: status.message);
}
}
Notes
- Android 11+: The plugin's
AndroidManifest.xmlalready declares the required<queries>entry forcom.evolute.sdkservice— no extra setup needed in your app. - Single instance: Create one
EvolutePrinterper screen and always calldisconnect()indispose()to avoid service leaks. - Images: Pass as
Uint8List(PNG or JPEG). The plugin decodes toBitmapnatively. Keep images under 100KB for reliable thermal printing. - SDK version: Developed and tested against
Evolute_SDK_Service_V02.09.00-01.
Repository
https://github.com/haelalhsen/evolute_printer_flutter
License
MIT
Libraries
- evolute_printer_flutter
- Flutter plugin for Evolute handheld integrated thermal printer.