Code Monkey home page Code Monkey logo

blue_thermal_printer's Introduction

blue_thermal_printer

pub package pub package

A new Flutter plugin for connecting to thermal printer via bluetooth (Android Only), this plugin is still under development Note: Migrate your project to AndroidX

Platform Support

Android iOS MacOS Web Linux Windows
✔️ ️X ️X ️X ️X ️X

Getting Started

  1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  blue_thermal_printer: ^any
  1. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

  1. Import it

Now in your Dart code, you can use:

 import 'package:blue_thermal_printer/blue_thermal_printer.dart';

EXAMPLE:

For detail demonstration please look at example folder

Note: make sure to upgrade your project to compileSdkVersion 31 or above

If you like my content, please consider buying me a coffee. Thank you for your support!

Buy Me A Coffee

ko-fi

bagi yang dari Indonesia bisa lewat saweria berikut

https://saweria.co/kakzaki

blue_thermal_printer's People

Contributors

flutter-painter avatar hmtuan196 avatar juliocbcotta avatar kakzaki avatar knight-dev avatar maurovanetti avatar mvanvu avatar tauqeerkhattak avatar wmattei avatar ziakhan110 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blue_thermal_printer's Issues

Reply already submitted

Dear kakzaki,

Thank you for thus useful widget. I really need this widget right now.

I have downloaded and try the example, but still face error when press connect button.

The app is automatically closed and sometime send me bug report like this:
Screenshot_2019-07-12-21-30-30-250_com miui bugreport

Really appreciate for your help.

Can't print images and QR codes

I'm getting this result when printing images. Any ideas? Also didn't succeed to print a QR code yet. Using the Jolimark TP510 and printing text works fine.
IMG_20200110_200058

SE ME RECORREN LAS LINEAS

Hola buenas tardes estoy utilizando tu paquete, pero al imprimir varias lineas las ultimas lineas se desfazan como te muestro en este ejemplo:

DISLAC

NO SE COMO SOLUCIONAR ESTO, ME PUEDES AYUDAR POR FAVOR.

Camera permission is added after building apk

Following camera permissions are added to android manifest file after building apk.

<uses-feature
    android:name="android.hardware.camera"
    android:required="false" />

<uses-feature
    android:name="android.hardware.camera.front"
    android:required="false" />

<uses-feature
    android:name="android.hardware.camera.autofocus"
    android:required="false" />

<uses-feature
    android:name="android.hardware.camera.flash"
    android:required="false" />

Steps to reproduce

  1. Create a flutter project
  2. Add blue_thermal_printer: ^1.1.1 dependency to pubspec.yaml
  3. Increase build.gradle minSdkVersion version to 18 located at <project_dir>/android/app/build.gradle
  4. Build apk Build -> Flutter -> Build APK
  5. Analyze apk Build -> Analyze APK ... select apk <project_dir>/build/app/outputs/flutter-apk/app-release.apk
  6. Check AndroidManifest.xml

you can see all used permissions.
Why do we need camera permission ? Is it possible to build without camera permission ?
Google is warning while uploading apk to playstore

Printer hardware

Not an issue... But what printer did you use in your testing?

QR Code Align

Hello kakzaki,

First of all thank you for this awesome library, and can you add some align setting for qr code or image ?
It would be very useful for printing like ticket etc.

Thank you very much.

Unhandled Exception: setState() called after dispose()

Hi! Thanks for the library it is simple and works great!

I am new to Flutter and still learning about state and widgets lifecycles, so I need help with this.

I have many print methods in code and after I send a text to the printer I pop out of that screen. I guess that's what's happening when I get this error:

W/BluetoothAdapter(27590): getBluetoothService() called with no BluetoothManagerCallback
D/BThermalPrinterPlugin(27590): android.bluetooth.device.action.ACL_CONNECTED
E/flutter (27590): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: setState() called after dispose(): _PrintReceiptCashScreenState#20d90(lifecycle state: defunct, not mounted)
E/flutter (27590): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
E/flutter (27590): The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
E/flutter (27590): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().

How to fix it?

Thanks.

Some lines failed to print.

I am having a (not always) printing problem, sometimes the printing is perfect and sometimes it does not print a few lines or an image for example. Is anyone going through this?

cannot print text

When I clicked print test button I got some messages and my printer did not print anything.

I/zygote64(19803): Do partial code cache collection, code=61KB, data=53KB
I/zygote64(19803): After code cache collection, code=60KB, data=53KB
I/zygote64(19803): Increasing code cache capacity to 256KB

my printer model is zenpert 3R20.

Print row features

is that possible to print tabular data? if possible, how to Print table row with this library? thanks

Confirmed working printer models?

I think it would be a great addition to the documentation of this project to add a list of confirmed working fine printer models. Currently we're looking to integrate receipt printing with flutter app and don't know which printer models would work without bugs with this library.

Font Style

I'm new on the world of Flutter, but I'm a quick learner. Everything that I was looking for were easy to found and implement. But now I'm needing a way to implement a Blueetooth Printer for my purpose, and I'm founding a lack of that on the Flutter world. After trying everything, the only package that worked so far for me was this one. The only problem is that the fonts are are not smooth for my readers to read.

So, is there a way of changing the font style? Like bold or the shape itself? That's the only package that worked with my printer (MTP-3), and the package is so nice to use. The only thing that is not helping me out is the font styling (and the spacing too, but I kind worked it out with a little bit of boilerplate but ok... xD).

I'll keep searching for ways to solve my problem and I'll be glad to post the answer here to help out anyone else with the same issue.

I'll apreciate any help. Even a little path to head on. Thank you!

'assembleAarRelease' not found in root project

Task 'assembleAarRelease' not found in root project 'blue_thermal_printer'.

This only happens when I try to flutter run --release

Apart from that debug and build appbundle work fine.

Thanks again for the plugin, super duper useful

Print on PeriPage

Any one knows if this library prints on PeriPage Bluetooth Thermal Printer, i tried many times but i cant print nothing, i can connect to the bluetooth but dont do nothing more.

uses-sdk:minSdkVersion 16 cannot be smaller than version 18 declared in library

**> /android/app/src/debug/AndroidManifest.xml Error:

    uses-sdk:minSdkVersion 16 cannot be smaller than version 18 declared in library [:bluetooth_print]**

I stuck on this error in 2 days. I found the solution to this issue.

Open printer_app/android/build.gradle:
Change the following line as lower version.

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 16  // Before it was 18
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
    }
}

However, I found the solution. I don't understand minSdk problem.

Error on bluetooth.connect(_device)

I`m getting this error below

Exception has occurred. PlatformException (PlatformException(connect_error, read failed, socket might closed or timeout, read ret: -1, java.io.IOException: read failed, socket might closed or timeout, read ret: -1 at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:741) at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:753) at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:375) at id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin.lambda$connect$0(BlueThermalPrinterPlugin.java:343) at id.kakzaki.blue_thermal_printer.-$$Lambda$BlueThermalPrinterPlugin$JxnBuByWzwnPoLoXadcl8ktG62Q.run(lambda) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:760) ))

It can't print qr_code or barcode

Hello is there any way i can print bar code using this on zebra ez320 because every time i print the result would be a Chinese character.

  • I also change the BarcodeFormat.QR_CODE into BarcodeFormat.CODE_128 (photo below)
    barcode

and this is the result
20200103_152824 1

error: package androidx.core.app does not exist

while i am running my flutter app its showing error like below.

Launching lib\main.dart on V2 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
C:\flutter.pub-cache\hosted\pub.dartlang.org\blue_thermal_printer-1.0.8\android\src\main\java\id\kakzaki\blue_thermal_printer\BlueThermalPrinterPlugin.java:13: error: package androidx.core.app does not exist
import androidx.core.app.ActivityCompat;
^
C:\flutter.pub-cache\hosted\pub.dartlang.org\blue_thermal_printer-1.0.8\android\src\main\java\id\kakzaki\blue_thermal_printer\BlueThermalPrinterPlugin.java:14: error: package androidx.core.content does not exist
import androidx.core.content.ContextCompat;
^
C:\flutter.pub-cache\hosted\pub.dartlang.org\blue_thermal_printer-1.0.8\android\src\main\java\id\kakzaki\blue_thermal_printer\BlueThermalPrinterPlugin.java:158: error: cannot find symbol
ContextCompat.startActivity(registrar.activity(), new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS),
^
symbol: variable ContextCompat
location: class BlueThermalPrinterPlugin
C:\flutter.pub-cache\hosted\pub.dartlang.org\blue_thermal_printer-1.0.8\android\src\main\java\id\kakzaki\blue_thermal_printer\BlueThermalPrinterPlugin.java:166: error: cannot find symbol
if (ContextCompat.checkSelfPermission(registrar.activity(),
^
symbol: variable ContextCompat
location: class BlueThermalPrinterPlugin
C:\flutter.pub-cache\hosted\pub.dartlang.org\blue_thermal_printer-1.0.8\android\src\main\java\id\kakzaki\blue_thermal_printer\BlueThermalPrinterPlugin.java:169: error: cannot find symbol
ActivityCompat.requestPermissions(registrar.activity(),
^
symbol: variable ActivityCompat
location: class BlueThermalPrinterPlugin
5 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':blue_thermal_printer:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 15s

The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.

Finished with error: Gradle task assembleDebug failed with exit code 1

Error, depois que conecta no dispositivo

Ele consegue escolher da lista, mas quando clico em conectar ele fecha o aplicativo.

E/BThermalPrinterPlugin(22619): at id.kakzaki.blue_thermal_printer.-$$Lambda$BlueThermalPrinterPlugin$JxnBuByWzwnPoLoXadcl8ktG62Q.run(Unknown Source:6) E/BThermalPrinterPlugin(22619): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) E/BThermalPrinterPlugin(22619): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/BThermalPrinterPlugin(22619): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/BThermalPrinterPlugin(22619): at java.lang.Thread.run(Thread.java:764) E/BThermalPrinterPlugin(22619): Reply already submitted E/BThermalPrinterPlugin(22619): java.lang.IllegalStateException: Reply already submitted E/BThermalPrinterPlugin(22619): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:126) E/BThermalPrinterPlugin(22619): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:230) E/BThermalPrinterPlugin(22619): at id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin.lambda$connect$0(BlueThermalPrinterPlugin.java:312) E/BThermalPrinterPlugin(22619): at id.kakzaki.blue_thermal_printer.-$$Lambda$BlueThermalPrinterPlugin$JxnBuByWzwnPoLoXadcl8ktG62Q.run(Unknown Source:6) E/BThermalPrinterPlugin(22619): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) E/BThermalPrinterPlugin(22619): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/BThermalPrinterPlugin(22619): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/BThermalPrinterPlugin(22619): at java.lang.Thread.run(Thread.java:764) E/AndroidRuntime(22619): FATAL EXCEPTION: AsyncTask #2 E/AndroidRuntime(22619): Process: id.kakzaki.blue_thermal_printer_example, PID: 22619 E/AndroidRuntime(22619): java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime(22619): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:126) E/AndroidRuntime(22619): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:230) E/AndroidRuntime(22619): at id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin.lambda$connect$0(BlueThermalPrinterPlugin.java:316) E/AndroidRuntime(22619): at id.kakzaki.blue_thermal_printer.-$$Lambda$BlueThermalPrinterPlugin$JxnBuByWzwnPoLoXadcl8ktG62Q.run(Unknown Source:6) E/AndroidRuntime(22619): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) E/AndroidRuntime(22619): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AndroidRuntime(22619): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime(22619): at java.lang.Thread.run(Thread.java:764) D/ViewRootImpl@c7866d9[MainActivity](22619): MSG_WINDOW_FOCUS_CHANGED 0 1 D/InputMethodManager(22619): prepareNavigationBarInfo() DecorView@27cc4a1[MainActivity] D/InputMethodManager(22619): getNavigationBarColor() -855310 I/Process (22619): Sending signal. PID: 22619 SIG: 9 Lost connection to device.

problems using printImageBytes

Hello I am trying to print an image using the printImageBytes method, but it gives me the following error:

D/skia    (18073): --- Failed to create image decoder with message 'unimplemented'
E/Print Photo error(18073): the file isn't exists

Here is the full code.

import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:blue_thermal_printer/blue_thermal_printer.dart';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:image/image.dart' as Img;
import 'package:barcode_image/barcode_image.dart' as Bcode;

class BluePrint extends StatefulWidget {
  static const String id = 'blue_print';
  @override
  _BluePrintState createState() => new _BluePrintState();
}

class _BluePrintState extends State<BluePrint> {
  BlueThermalPrinter bluetooth = BlueThermalPrinter.instance;

  List<BluetoothDevice> _devices = [];
  BluetoothDevice _device;
  bool _connected = false;
  bool _pressed = false;
  String pathImage;

  @override
  void initState() {
    super.initState();
    initPlatformState();
    //initSavetoPath();
  }

  initSavetoPath() async {
    //read and write
    //image max 300px X 300px
    final filename = 'yourlogo.png';
    var bytes = await rootBundle.load("assets/images/yourlogo.png");
    String dir = (await getApplicationDocumentsDirectory()).path;
    writeToFile(bytes, '$dir/$filename');
    setState(() {
      pathImage = '$dir/$filename';
    });
  }

  Future<void> initPlatformState() async {
    List<BluetoothDevice> devices = [];

    try {
      devices = await bluetooth.getBondedDevices();
    } on PlatformException {
      // TODO - Error
    }

    bluetooth.onStateChanged().listen((state) {
      switch (state) {
        case BlueThermalPrinter.CONNECTED:
          setState(() {
            _connected = true;
            _pressed = false;
          });
          break;
        case BlueThermalPrinter.DISCONNECTED:
          setState(() {
            _connected = false;
            _pressed = false;
          });
          break;
        default:
          print(state);
          break;
      }
    });

    if (!mounted) return;
    setState(() {
      _devices = devices;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Blue Thermal Printer'),
        ),
        body: Container(
          child: ListView(
            children: <Widget>[
              Padding(
                padding: const EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: <Widget>[
                    Text(
                      'Device:',
                      style: TextStyle(
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    DropdownButton(
                      items: _getDeviceItems(),
                      onChanged: (value) => setState(() => _device = value),
                      value: _device,
                    ),
                    RaisedButton(
                      onPressed:
                          _pressed ? null : _connected ? _disconnect : _connect,
                      child: Text(_connected ? 'Disconnect' : 'Connect'),
                    ),
                  ],
                ),
              ),
              Padding(
                padding:
                    const EdgeInsets.only(left: 10.0, right: 10.0, top: 50),
                child: RaisedButton(
                  onPressed: _connected ? _tesPrint : null,
                  child: Text('TesPrint'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

  List<DropdownMenuItem<BluetoothDevice>> _getDeviceItems() {
    List<DropdownMenuItem<BluetoothDevice>> items = [];
    if (_devices.isEmpty) {
      items.add(DropdownMenuItem(
        child: Text('NONE'),
      ));
    } else {
      _devices.forEach((device) {
        items.add(DropdownMenuItem(
          child: Text(device.name),
          value: device,
        ));
      });
    }
    return items;
  }

  void _connect() {
    if (_device == null) {
      show('No device selected.');
    } else {
      bluetooth.isConnected.then((isConnected) {
        if (!isConnected) {
          bluetooth.connect(_device).catchError((error) {
            setState(() => _pressed = false);
          });
          setState(() => _pressed = true);
        }
      });
    }
  }

  void _disconnect() {
    bluetooth.disconnect();
    setState(() => _pressed = true);
  }

//write to app path
  Future<void> writeToFile(ByteData data, String path) {
    final buffer = data.buffer;
    return new File(path).writeAsBytes(
        buffer.asUint8List(data.offsetInBytes, data.lengthInBytes));
  }

  void _tesPrint() async {
    //SIZE
    // 0- normal size text
    // 1- only bold text
    // 2- bold with medium text
    // 3- bold with large text
    //ALIGN
    // 0- ESC_ALIGN_LEFT
    // 1- ESC_ALIGN_CENTER
    // 2- ESC_ALIGN_RIGHT

    final img = Img.Image(300, 300);
    Img.fill(img, Img.getColor(255, 255, 255));
    Bcode.drawBarcode(img, Bcode.Barcode.pdf417(), 'Test');

    bluetooth.isConnected.then((isConnected) {
      if (isConnected) {
        print(img.getBytes());
        bluetooth.printCustom("HEADER", 3, 1);
        bluetooth.printNewLine();
        //bluetooth.printImage(pathImage);
        bluetooth.printNewLine();
        bluetooth.printLeftRight("LEFT", "RIGHT", 0);
        bluetooth.printLeftRight("LEFT", "RIGHT", 1);
        bluetooth.printNewLine();
        bluetooth.printLeftRight("LEFT", "RIGHT", 2);
        bluetooth.printCustom("Body left", 1, 0);
        bluetooth.printCustom("Body right", 0, 2);
        bluetooth.printNewLine();
        bluetooth.printCustom("Terimakasih", 2, 1);
        bluetooth.printNewLine();
        //bluetooth.printQRcode("Insert Your Own Text to Generate", 10, 10, 0);
        bluetooth.printImageBytes(img.getBytes());
        bluetooth.printNewLine();
        bluetooth.printNewLine();
        bluetooth.printCustom("cool", 3, 1);
        bluetooth.paperCut();
      }
    });
  }

  Future show(
    String message, {
    Duration duration: const Duration(seconds: 3),
  }) async {
    await new Future.delayed(new Duration(milliseconds: 100));
    Scaffold.of(context).showSnackBar(
      new SnackBar(
        content: new Text(
          message,
          style: new TextStyle(
            color: Colors.white,
          ),
        ),
        duration: duration,
      ),
    );
  }
}

Activity com.example.thermaldemo.MainActivity has leaked IntentReceiver

D/ActivityThread( 6209): ACT-DESTROY_ACTIVITY handled : 1 / android.os.BinderProxy@3b0942ce
E/ActivityThread( 6209): Activity com.example.thermaldemo.MainActivity has leaked IntentReceiver id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin$1$1@d37b3f4 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 6209): android.app.IntentReceiverLeaked: Activity com.example.thermaldemo.MainActivity has leaked IntentReceiver id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin$1$1@d37b3f4 that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 6209):        at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:932)
E/ActivityThread( 6209):        at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:703)
E/ActivityThread( 6209):        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1731)
E/ActivityThread( 6209):        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1711)
E/ActivityThread( 6209):        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1705)
E/ActivityThread( 6209):        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:488)
E/ActivityThread( 6209):        at id.kakzaki.blue_thermal_printer.BlueThermalPrinterPlugin$1.onListen(BlueThermalPrinterPlugin.java:620)
E/ActivityThread( 6209):        at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:193)
E/ActivityThread( 6209):        at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:172)
E/ActivityThread( 6209):        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:90)
E/ActivityThread( 6209):        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:234)
E/ActivityThread( 6209):        at android.os.MessageQueue.nativePollOnce(Native Method)
E/ActivityThread( 6209):        at android.os.MessageQueue.next(MessageQueue.java:143)
E/ActivityThread( 6209):        at android.os.Looper.loop(Looper.java:146)
E/ActivityThread( 6209):        at android.app.ActivityThread.main(ActivityThread.java:5529)
E/ActivityThread( 6209):        at java.lang.reflect.Method.invoke(Native Method)
E/ActivityThread( 6209):        at java.lang.reflect.Method.invoke(Method.java:372)
E/ActivityThread( 6209):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
E/ActivityThread( 6209):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
I/Process ( 6209): Sending signal. PID: 6209 SIG: 9
Lost connection to device.

I am running the example app. Whenever i pressed the button connect to the device the app terminates unexpectedly. Thank You

content not printed successfully

Hi when i print by hoinprinter.com printer, the paper printed like this!

in this image, the same logo and the same QR code.
and the english text dose not appear , please help me...

71037990_519342992133571_5987590860559089664_n

gradlew.bat exited abnormally

I got this when i run the code:
Resolving dependencies...

  • Error running Gradle:
    ProcessException: Process "C:\Users\DELL\Desktop\flutter\blue_thermal_printer-master\example\android\gradlew.bat" exited abnormally:
    Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :app
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Command: C:\Users\DELL\Desktop\flutter\blue_thermal_printer-master\example\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

Thank you in advance

Arabic lang

The printer is working but not working with Arabic lang
Any help

print chinese

Excuse me, I use Chinese to print, the result is scrambled code, how to solve?

Save printer into app

Hello, how can I save the printer into the app when its connected for the first time.

My printer is a MHT-P28A, work perfectly but in every new invoice I need to connect the printer again

Thank you in advance if somebody can give me a example

Connection status

Connection is ok, but :

  • When printer is connected, view does not display that printer is connected
  • Printer name does not appear on the drop down
  • Connect button shows connect instead of disconnect

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.