Git Product home page Git Product logo

thermal_printer's People

Contributors

rahuldevgarg avatar shashikantdwivedi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

thermal_printer's Issues

Fine Location permission

In my opinion, it should be documented in the README why exactly this plugin needs location permissions, and also why the FINE / precise location is required. It is not directly apparent why this permission is needed, which also makes App store submissions (especially Apple) very difficult.

New mutable implicit PendingIntent Error

I'm getting following error message. Please fix it in upcoming release

New mutable implicit PendingIntent: pkg=xxx.xxx.xxx=com.flutter_pos_printer.USB_PERMISSION, featureId=null. This will be blocked once the app targets U+ for security reasons.

Want to Print using TSPL command

I've to print laundry garment tag from TSC TTP 244 PRO Barcode Printer . It support TSPL command. Can you please provide me example to print Text + QR code using TSPL command . I have found lib has a method to print image using TSPL command. It support only image input?
Please help me

Targeting Android 14 Give a Bluetooth Error. Work Fine in 13 an below.

I think may be related to this: Android 14 enforces the BLUETOOTH_CONNECT permission when calling the BluetoothAdapter getProfileConnectionState() method for apps targeting Android 14 (API level 34) or higher.

This method already required the BLUETOOTH_CONNECT permission, but it was not enforced. Make sure your app declares BLUETOOTH_CONNECT in your app's AndroidManifest.xml file as shown in the following snippet and check that a user has granted the permission before calling getProfileConnectionState.

And maybee we just need the runtime permission.

Left most column in Generator.row not left-aligned properly

Hi, thanks for developed this cool library!

I got an issue when I use generator.row and generator.textLeftRight to print a row, the leftmost column is not left-aligned properly.

WhatsApp Image 2024-05-19 at 11 31 57 AM(1)

Here is my code:

      bytes += _generator.hr(ch: '=');
      final receiptNumber = label.receiptNumber;
      final shippingTotalWeight = '${label.shippingTotalWeight} kg';
      final shippingCost = Formatter.currency(label.shippingCost as int);
      bytes += _generator.row([
        PosColumn(
          text: 'Pengiriman',
          width: 6,
        ),
        PosColumn(
          text: receiptNumber,
          width: 6,
          styles: const PosStyles(align: PosAlign.right),
        ),
      ]);
      bytes += _generator.textLeftRight('Berat', shippingTotalWeight);
      bytes += _generator.textLeftRight('Ongkir', shippingCost);
      bytes += _generator.hr();bytes += _generator.hr(ch: '=');

Here is my Generator configuration:

  @preResolve
  Future<Generator> get generator async => Generator(PaperSize.mm80, await CapabilityProfile.load());

and I used CP1252 global code table.

Is there any way to fix this? Thank you!

ios build

Error (Xcode): In /Users/mac/.pub-cache/hosted/pub.dev/thermal_printer-1.0.4/ios/libGSDK.a(BLEConnecter.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/mac/.pub-cache/hosted/pub.dev/thermal_printer-1.0.4/ios/libGSDK.a' for architecture arm64

A number is printed in all PosColumns in row()

When i use generator.row() to print a row, then a number is printed before all columns except the first one.
For example, for a row like below:

bytes += generator.row([
PosColumn(width: 8, text: 'Lemon lime x 5 units', styles: const PosStyles(align: PosAlign.left, codeTable: 'CP1252')),
PosColumn(width: 4, text: 'USD 2.00', styles: const PosStyles(align: PosAlign.right, codeTable: 'CP1252')),
]);

Expected output:
Lemon lime x 5 units         USD 2.00

Current output:
Lemon lime x 5 units         2USD 2.00

Here, the number '2' is added to the print. if the alignment of the second column was PosAlign.left then '0' would have been added and if the alignment was PosAlign.center, then '1' would have been added.

Why is the number being added and how can I avoid it?

Bluetooth state not changing after disconnect

I am using the thermal_printer package in Flutter to connect to a Bluetooth printer. When I call the disconnect() method, the Bluetooth state does not change from "connected" to "disconnected/none".

I have tested this on Android.

Expected behaviour:

The Bluetooth state should change to "disconnected/none" after calling disconnect().

**Actual behaviour

WhatsApp.Video.2024-02-25.at.9.42.40.AM.mp4

:**

The Bluetooth state remains "connected" after calling disconnect().

lateinit property bluetoothService has not been initialized

lateinit property bluetoothService has not been initialized

Whenever I try to use a Bluetooth printer (weirdly USB as well), I get this error message. I can confirm that the package worked with version 1.0.5 on this same device before. Bluetooth is enabled in the device settings.

In this case, this is what the output looks like when the scan() method is called.

E/MethodChannel#com.codingdevs.thermal_printer(15934): Failed to handle method call
E/MethodChannel#com.codingdevs.thermal_printer(15934): kotlin.UninitializedPropertyAccessException: lateinit property bluetoothService has not been initialized
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at com.codingdevs.thermal_printer.ThermalPrinterPlugin.verifyIsBluetoothIsOn(ThermalPrinterPlugin.kt:307)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at com.codingdevs.thermal_printer.ThermalPrinterPlugin.onMethodCall(ThermalPrinterPlugin.kt:212)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at android.os.Handler.handleCallback(Handler.java:959)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at android.os.Handler.dispatchMessage(Handler.java:100)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at android.os.Looper.loopOnce(Looper.java:232)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at android.os.Looper.loop(Looper.java:317)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at android.app.ActivityThread.main(ActivityThread.java:8516)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/MethodChannel#com.codingdevs.thermal_printer(15934): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
E/flutter (15934): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, lateinit property bluetoothService has not been initialized, null, kotlin.UninitializedPropertyAccessException: lateinit property bluetoothService has not been initialized
E/flutter (15934): 	at com.codingdevs.thermal_printer.ThermalPrinterPlugin.verifyIsBluetoothIsOn(ThermalPrinterPlugin.kt:307)
E/flutter (15934): 	at com.codingdevs.thermal_printer.ThermalPrinterPlugin.onMethodCall(ThermalPrinterPlugin.kt:212)
E/flutter (15934): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter (15934): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (15934): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter (15934): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (15934): 	at android.os.Handler.handleCallback(Handler.java:959)
E/flutter (15934): 	at android.os.Handler.dispatchMessage(Handler.java:100)
E/flutter (15934): 	at android.os.Looper.loopOnce(Looper.java:232)
E/flutter (15934): 	at android.os.Looper.loop(Looper.java:317)
E/flutter (15934): 	at android.app.ActivityThread.main(ActivityThread.java:8516)
E/flutter (15934): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter (15934): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/flutter (15934): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
E/flutter (15934): )
E/flutter (15934): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter (15934): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter (15934): <asynchronous suspension>
E/flutter (15934): 

dart_ping requires 3.0.0 <4.0.0 but ours Dart SDK version is 2.18.6.

The current Dart SDK version is 2.18.6.

Because orderz depends on dart_ping >=9.0.0 which requires SDK version >=3.0.0 <4.0.0, version solving failed.
pub get failed (1; Because orderz depends on dart_ping >=9.0.0 which requires SDK version >=3.0.0 <4.0.0, version solving failed.)

not work on ios

when i testing on android it work normal but not work in ios. it show message please review your connection .

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.