v0.0.14
blue_print_pos
블루투스 프린터 장치에 연결하는 플러그인으로, Android 및 iOS를 지원합니다
56좋아요 6730일 다운로드70Pub 점수
플랫폼 정보 없음
Android 및 iOS에서 블루투스 프린트를 사용하기 위한 도우미
^1.2.0^2.0.1+6{"sdk":"flutter"}^1.1.2^3.1.3^4.0.0{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
This plugin to help use bluetooth printer in Android/iOS. Support for text, image, add new line or line dashed and QR.
BluePrintPos bluePrintPos = BluePrintPos.instance;
bluePrintPos.scan();
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');
final ByteData logoBytes = await rootBundle.load('assets/logo.jpg');
receiptText.addImage(
base64.encode(Uint8List.view(logoBytes.buffer)),
width: 150,
);
receiptText.addSpacer();
receiptText.addSpacer(useDashed: true);
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"/>
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>
Reference and dependencies create this plugin