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
x
Print text with stylex
Print qrcode (with style)x
Print barcode (with style)x
Jump n-linesx
Cut paperx
Get printer statusx
Get printer cover statusx
Open and close LCD screenx
Show text on LCD screenx
Show QR code on LCD screenx
Show Image on LCD screen (url, assets)x
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