v0.3.2
flutter_usb_printer
इस प्लगइन के उपयोग से डेवलपर डेटा भेज सकते हैं और एंड्रॉइड पर यूएसबी प्रिंटर का उपयोग कर सकते हैं।
28लाइक 1.5 हज़ार30-दिन डाउनलोड150Pub अंक
Android
kechankrisna/flutter_usb_printer open-source repository details.
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This plugin will allow develop send data and work with usb printer on android
flutter pub add flutter_usb_printer
_getDevicelist() async {
List<Map<String, dynamic>> results = [];
results = await FlutterUsbPrinter.getUSBDeviceList();
print(" length: ${results.length}");
setState(() {
devices = results;
});
}
_connect(int vendorId, int productId) async {
bool returned;
try {
returned = await flutterUsbPrinter.connect(vendorId, productId);
} on PlatformException {
//response = 'Failed to get platform version.';
}
if (returned) {
setState(() {
connected = true;
});
}
}
_print() async {
try {
var data = Uint8List.fromList(
utf8.encode(" Hello world Testing ESC POS printer..."));
await flutterUsbPrinter.write(data);
// await FlutterUsbPrinter.printRawData("text");
// await FlutterUsbPrinter.printText("Testing ESC POS printer...");
} on PlatformException {
//response = 'Failed to get platform version.';
}
}
निर्भरता सूची 3 आइटम
{"sdk":"flutter"}{"sdk":"flutter"}^5.0.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗