flutter_usb_printer 0.3.0
flutter_usb_printer: ^0.3.0 copied to clipboard
This plugin will allow develop send data and work with usb printer on android
0.3.0 #
Breaking Changes #
minSdkraised from 16 to 24
New Features #
- USB permission dialog is now shown automatically when a device is plugged in (via
USB_DEVICE_ATTACHEDintent-filter anddevice_filter.xml)
Bug Fixes #
- Permission flow:
connect()now waits for the user to respond to the USB permission dialog before resolving — previously it returnedtrueimmediately before the user even saw the dialog - Permission check:
hasPermission()is checked before callingrequestPermission()— no redundant dialog when permission is already granted - Connection reliability:
openConnection()now scans all USB interfaces (not just index 0) to find the BULK OUT endpoint, fixing printers that expose the print interface at index 1+ - Silent failure fixed:
openConnection()previously returnedtrueeven when no endpoint was found, causing a silent NPE onbulkTransfer; it now returnsfalsewith a clear log message - Transfer result:
write(),printText(), andprintRawText()now return the actual transfer result (b >= 0) instead of always returningtrue - Null crash: Fixed
NullPointerExceptionin the USB permission broadcast receiver whenEXTRA_DEVICEis absent on permission denial - UI null crash: Fixed crash in device list when
manufacturerorproductNamefields are null
Maintenance #
- Migrated Android build to AGP 8.11.1, Gradle 8.14, Kotlin 2.2.20
- Migrated to Kotlin DSL (
build.gradle.kts) and new Flutter Gradle plugin DSL - Fixed deprecated
getParcelableExtraAPI (Android 13+) - Fixed deprecated
buildDirsetter/getter (replaced withlayout.buildDirectory) - Replaced raw
Thread{}with Kotlin Coroutines for proper error propagation - Migrated test mocking to
TestDefaultBinaryMessengerBindingAPI - Added
flutter_lintsandanalysis_options.yaml - Added
android:exported="true"toMainActivity(required for Android 12+)
0.2.0 #
- Upgraded to Flutter 3.41.9 / Dart 3.9.2+
- Migrated Android build to AGP 8.11.1, Gradle 8.14, Kotlin 2.2.20
- Migrated to Kotlin DSL (build.gradle.kts) and new Flutter Gradle plugin DSL
- Raised minSdk from 16 to 24 (breaking change)
- Fixed deprecated getParcelableExtra API (Android 13+)
- Replaced raw Thread{} with Kotlin Coroutines for proper error propagation
- Fixed printText/printRawText always returning true regardless of actual result
- Fixed non-true singleton pattern in USBPrinterAdapter
- Migrated test mocking to TestDefaultBinaryMessengerBinding API
- Added flutter_lints and analysis_options.yaml
0.1.0+1 #
- fixed Future
0.1.0 #
- null safety
0.0.1 #
- first release