d1_terminal_plugin 0.0.1
d1_terminal_plugin: ^0.0.1 copied to clipboard
This plugin for D1 Terminal allows you to control the printer and LCD screen.
d1_terminal_plugin #
This plugin for D1 Terminal allows you to control the printer and LCD screen.
Platform Support #
This plugin works only on android
Usage #
To use this plugin, add d1_terminal_plugin
as a dependency in your pubspec.yaml file
What this package do #
- Print text with style
- Print qrcode (with style)
- Print barcode (with style)
- Jump n-lines
- Cut paper
- Get printer status
- Get printer cover status
- Open and close LCD screen
- Show text on LCD screen
- Show QR code on LCD screen
- Show Image on LCD screen (url, assets)
- Show scan QR code
Example #
Import the library.
import 'package:d1_terminal_plugin/d1_terminal_plugin.dart';
Printer #
Print text
D1TerminalPlugin.instance.printText(text: 'Siparişim+');
D1TerminalPlugin.instance.printStart();
Print barcode
D1TerminalPlugin.instance.printBarCode(
text: '120102012',
symbology: D1BarcodeCodeSystem.CODABAR,
);
D1TerminalPlugin.instance.printStart();
Print qrcode
D1TerminalPlugin.instance.printQRCode(text: 'Siparişim', size: 2, align: D1TextAlign.center);
D1TerminalPlugin.instance.printStart();
Cut Paper
D1TerminalPlugin.instance.cutPaper();
Get printer status
final result = await D1TerminalPlugin.instance.getPrinterStatus();
Get printer cover status
final result = await D1TerminalPlugin.instance.isPrinterCoverOpen();
Line feed
D1TerminalPlugin.instance.lineFeed(5);
LCD Screen #
Show QR code on LCD screen
D1TerminalPlugin.instance.showText('Hello World', D1TextAlign.start);
Scan QR
D1TerminalPlugin.instance.showQRScan.call().then((value) {
debugPrint('QR: $value');
D1TerminalPlugin.instance.showText('QR: $value', D1TextAlign.center);
}).onError((error, stackTrace) {
debugPrint(''Time Out'');
});
Open Screen
D1TerminalPlugin.instance.openScreen();
Close Screen
D1TerminalPlugin.instance.closeScreen();
Show QR Code on LCD screen
D1TerminalPlugin.instance.showQRCode('QR Code'),
Show Image asset on LCD screen
D1TerminalPlugin.instance.showImageAsset(imageAsset);
Show Image Network on LCD screen
D1TerminalPlugin.instance.showImageUrl(imageUrl);
NOTE
You must add support multidex ===> add support multidex