rongta_printer

Last updated:

0 purchases

rongta_printer Image
rongta_printer Images
Add to Cart

Description:

rongta printer

rongta_printer #



A Flutter plugin for printing using Rongta thermal printers. 🖨️
Features #

Print anything 🤯: Print any widget shape, bypassing the limitations of the Rongta native SDK.
Be aware of the printer status 💡: Receive updates about printer connection and document transmission.

Installation #
Add the following dependency to your pubspec.yaml file:
plugin_name: ^1.0.0
copied to clipboard
Setup #
The code works for Android out of the box, and has 1 step to setup iOS.
🔧 iOS Setup #
To run the plugin on iOS, you need to add the bluetooth framework, to do so please follow these steps:

Tap on runner from the left side navigator.
Select the target from the targets list.
Tap on build phases.
Add a new "Link Binary With Libraries" by hitting the + button.
Type "Bluetooth" in the search bar and choose the CoreBluetooth.framework.


Usage #
Import the package into your Dart file:
import 'package:rongta_printer/rongta_printer.dart';
copied to clipboard
Example #
Initialize the connection with the printer:
...
final _rongtaPrinterPlugin = RongtaPrinter();

void onConnectionStatusChanged(PrinterConnectionStatus status) {...}
void onOperationStatusChanged(PrinterOperationStatus status) {...}
...
await _rongtaPrinterPlugin.init(
macAddress: 'DC:0D:30:95:39:A2',
onPrinterConnectionChange: onConnectionStatusChanged,
onDocPrinted: onOperationStatusChanged,
);
...
copied to clipboard
Print your document:
...
_rongtaPrinterPlugin.print(
doc: Column(
children: const [
FlutterLogo(),
Text('Rongta printing example'),
],
),
);
...
copied to clipboard
Known Issues ❗️ #

Using Image.memory will not display anything, as the code loads images instantly, while loading from memory takes time.

License #
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributing #
Contributions are welcome! Please feel free to submit a pull request.
Acknowledgments #
The code is built on top of the Rongta SDKs for Android and iOS, which can be found here. 🙌

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.