blue_print_pos 0.0.4
blue_print_pos: ^0.0.4 copied to clipboard

Plugin to connecting bluetooth printer device, support on Android and iOS

Introduction #

This plugin to help use bluetooth printer in Android/iOS. Support for text, image, add new line or line dashed and QR.

Usage #

Initialize #

BluePrintPos bluePrintPos = BluePrintPos.instance; 

Scan bluetooth printer #

bluePrintPos.scan();

Connect bluetooth printer #

bluePrintPos.connect(device);

In method .addText(text, {size, style, alignment}) you can modify size, style and alignment

ReceiptSectionText receiptText = ReceiptSectionText();
receiptText.addText('MY STORE', size: ReceiptTextSizeType.medium, style: ReceiptTextStyleType.bold);
receiptText.addLeftRightText('Time', '04/06/21, 10:00');
ByteData bytes = await rootBundle.load('assets/logo.jpg');
await bluePrintPos.printReceiptImage(bytes.buffer.asUint8List(), width: 120);

Add new line #

receiptText.addSpacer();

Add new line with dash #

receiptText.addSpacer(useDashed: true);

Getting Started #

Android #

Change the minSdkVersion in android/app/build.gradle in 19

android {
  defaultConfig {
     minSdkVersion 19
  }
}

Add permission for Bluetooth and access location in android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

iOS #

Add info key in ios/Runner/Info.plist

<key>NSBluetoothAlwaysUsageDescription</key>  
<string>Need BLE permission</string>  
<key>NSBluetoothPeripheralUsageDescription</key>  
<string>Need BLE permission</string>  
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>  
<string>Need Location permission</string>  
<key>NSLocationAlwaysUsageDescription</key>  
<string>Need Location permission</string>  
<key>NSLocationWhenInUseUsageDescription</key>  
<string>Need Location permission</string>

Thanks to #

Reference and dependencies create this plugin

2
likes
100
pub points
37%
popularity

Publisher

Unknown

Plugin to connecting bluetooth printer device, support on Android and iOS

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

blue_thermal_printer, esc_pos_utils_plus, flutter, flutter_blue, image, qr_flutter, webcontent_converter

More

Packages that depend on blue_print_pos