urovo_pos 0.1.3
urovo_pos: ^0.1.3 copied to clipboard
Flutter plugin for Urovo POS (Android), starting with printer APIs and modular feature expansion.
Urovo POS #
Standalone Flutter plugin for Urovo POS devices, designed for incremental feature delivery.
v0.1.x implements printing only and is structured for future additions (scanner, beeper, pinpad) in the same package.
Tested on Urovo SDK version v1.0.13.
v0.1.x scope (printer) #
- Runtime SDK availability check (
isUrovoSdkAvailable) - Printer lifecycle
printerInitprinterCloseprinterGetStatusprinterGetStatusDetailprinterSetGrayprinterStartPrint
- Print job pipeline
printerRunJob(UrovoPrintJob)
- Print primitives exposed via
UrovoPrintJobtextblackLinetextLeftRighttextLeftCenterRightbarcodeqrimageBytesfeedLinepaperFeed
- Built-in demo helper:
printSample()printSample()only builds/runs the sample job; it does not auto-callprinterInit/printerClose.
Upcoming features (roadmap) #
v0.2.0: scanner APIs (scan start/stop + decoded payload stream)v0.3.0: beeper APIs + shared device status utilitiesv0.4.0: pinpad wrappers (non-sensitive operations only)v0.5.0: capability registry (isPrinterAvailable,isScannerAvailable,isPinpadAvailable)v1.0.0: stabilized printing + scanning contract
Legal and licensing #
This package does not include Urovo proprietary SDK binaries. You must obtain Urovo SDK files under your own license agreement and add them to your Android app module. You are responsible for complying with Urovo licensing and distribution terms.
Android setup (add Urovo SDK AAR) #
-
Copy Urovo AAR into your app module:
android/app/libs/urovoSDK-v1.0.13.aar -
In
android/app/build.gradle:
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
// optional explicit:
// implementation(name: "urovoSDK-v1.0.13", ext: "aar")
}
- In
android/app/build.gradle.kts:
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
// optional explicit:
// implementation(files("libs/urovoSDK-v1.0.13.aar"))
}
- Optional (if your Gradle setup needs it):
repositories {
flatDir {
dirs "libs"
}
}
Run example on real POS (feature test) #
-
Put the vendor AAR in the example app:
example/android/app/libs/urovoSDK-v1.0.13.aar -
Connect your Urovo POS and confirm Flutter sees it:
flutter devices
- Run the example app on the POS:
cd example
flutter pub get
flutter run
-
In the example UI, use this test flow:
Check SDKInit PrinterGet StatusPrint Sample TextPrint Table DemoPrint Demo ReceiptClose Printer
-
Confirm logs show successful operations and printed output matches commands.
Quick usage #
import 'package:urovo_pos/urovo_pos.dart';
Future<void> printReceipt() async {
final available = await UrovoPos.isUrovoSdkAvailable();
if (!available) {
throw Exception('Urovo SDK not found.');
}
final job = UrovoPrintJob()
..setGray(8)
..text(
'UROVO POS',
style: const UrovoTextStyle(
align: UrovoAlign.center,
bold: true,
font: UrovoFont.large,
),
)
..blackLine()
..textLeftCenterRight('Item A', 'x1', '100,000')
..barcode('123456789012')
..qr('https://urovo.example/receipt/1')
..feedLine(2);
await UrovoPos.printerInit();
try {
await UrovoPos.printerRunJob(job);
} finally {
await UrovoPos.printerClose();
}
}
Lifecycle contract (manual) #
This plugin uses manual lifecycle control. It does not auto-open or auto-close printer sessions.
Required sequence for printer transactions:
printerInit()- One or more operations:
printerGetStatusDetail()printerSetGray(...)printerRunJob(...)printerStartPrint()
printerClose()
printSample() also requires an opened session:
await UrovoPos.printerInit();
try {
await UrovoPos.printSample();
} finally {
await UrovoPos.printerClose();
}
Status mapping #
Public Dart API does not expose raw Urovo status integers.
Mapped printer status enum:
okpaperEndedhardErroroverheatlowVoltagemotorErrorbusyunknown
Troubleshooting #
sdk_not_found: AAR is missing from app moduleandroid/app/libs.not_initialized: callprinterInitbeforeprinterGetStatusDetail,printerSetGray,printerStartPrint,printerRunJob, orprintSample.device_unavailable: printer init/status failed (paper, voltage, hardware, busy).print_failed:startPrintfailed. Check status detail message and recommendation.invalid_argument: malformed job payload or invalid gray/input values.