bluetooth_print 0.1.0 copy "bluetooth_print: ^0.1.0" to clipboard
bluetooth_print: ^0.1.0 copied to clipboard

outdated

A new flutter plugin project connect to bluetooth thermal printer (Gprinter).

pub package

Introduction #

BluetoothPrint is a bluetooth plugin for Flutter, a new mobile SDK to help developers build bluetooth thermal printer apps for both iOS and Android.(for example, Gprinter pt-380 eg.)

Features #

ios features maybe finished before this month end(eg. 2019/12/30)

Android iOS Description
select devices ✅ scan for Bluetooth Low Energy devices and select.
connect ✅ Establishes a connection to the device.
disconnect ✅ Cancels an active or pending connection to the device.
print test message ✅ print device test message.
print text ✅ print custom text, support layout.
print image ✅ print image.
print qrcode ✅ print qrcode,support change size.
display connect status ✅ Stream of state changes for the Bluetooth Device.

Usage #

Example

To use this plugin :

  dependencies:
    flutter:
      sdk: flutter
    bluetooth_print:
  • init a BluetoothPrint instance
import 'package:bluetooth_print/bluetooth_print.dart';
import 'package:bluetooth_print/bluetooth_print_model.dart';


BluetoothPrint bluetoothPrint = BluetoothPrint.instance;

getDevices #

List<BluetoothDevice> list = await bluetoothPrint.getBondedDevices();

connect #

await bluetoothPrint.connect(_device);

disconnect #

await bluetoothPrint.disconnect();

listen state #

      bluetoothPrint.state.listen((state) {
      print('cur device status: $state');

      switch (state) {
        case BluetoothPrint.CONNECTED:
          setState(() {
            _connected = true;
          });
          break;
        case BluetoothPrint.DISCONNECTED:
          setState(() {
            _connected = false;
          });
          break;
        default:
          break;
      }
    });
276
likes
0
points
325
downloads

Publisher

unverified uploader

Weekly Downloads

A new flutter plugin project connect to bluetooth thermal printer (Gprinter).

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, json_annotation

More

Packages that depend on bluetooth_print

Packages that implement bluetooth_print