FLUTTER ECOSYSTEM

Eddayy/flutter_star_prnt

星型打印机的 Flutter 插件

flutter_star_prnt 项目封面
Stars
17
Forks
80
最近推送(UTC)
2024年8月20日
项目状态
未归档
Edmund Tay GitHub avatar
GITHUB User

Edmund Tay ↗

Running late or lately running?

Malaysia
语言Objective-CSwiftKotlinDartCRuby

技术话题

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • collection^1.15.0
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

flutter_star_prnt

Pub Version

Flutter plugin for Star micronics printers.

Native code based on React Native and Ionic/Cordova version
React native Version ➜ here
Ionic/Cordova Version ➜ here

Looking for maintainer

I'm looking for someone to take over the maintenance of this package as currently I don't work on flutter or Star Micromics printer, I can't really validate any changes on Star Micromics native code. Please open an issue if you're interested, generally I'm just looking for someone that can give me confidence you won't just hijack the package for something else.

Updating from 1.0.4 and lower

If you're having trouble please run these commands

rm -rf ios/Pods && rm ios/Podfile.lock && flutter clean

Getting Started

import 'package:flutter_star_prnt/flutter_star_prnt.dart';

// Find printers
List<PortInfo> list = await StarPrnt.portDiscovery(StarPortType.All);

list.forEach((port) async {
/// Check status
await StarPrnt.checkStatus(portName: port.portName,emulation: 'StarGraphic',)
}

///send print commands to printer
PrintCommands commands = PrintCommands();
commands.push({
 'appendBitmapText': "Hello World"
});
commands.push({
 'appendCutPaper': "FullCutWithFeed"
});
await StarPrnt.print(portName: port.portName, emulation: 'StarGraphic',printCommands: commands)

Android

Permissions required depending on your printer:

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

Ios

Need to add this into your info.plist for bluetooth printers

<key>UISupportedExternalAccessoryProtocols</key>
  <array>
    <string>jp.star-m.starpro</string>
  </array>

Work in progress

  • [ ] Added documentations in readme

Documentation work in progress, please refer to react native or Ionic/Cordova's documentations for command format