thermal_print 0.0.2
thermal_print: ^0.0.2 copied to clipboard
A flutter package which will help to print from thermal printer.
POS Thermal printer package. This package extends from esc_pos_print package
Features #
- Print direct text
- Print widget screenshot
Getting started #
use this git to pubspec.yaml
Usage #
- Register the
PrintApias abstract andThermalPrint()as implementation togetItsingleton.
final getIt = GetIt.instance;
void setupLocator() {
getIt.registerSingleton<PrintApi>(ThermalPrint());
}
- Initialize the
initializemethod, from main
void main() async {
WidgetsFlutterBinding.ensureInitialized();
setupLocator();
await getIt<PrintApi>().initialize();
runApp(const MyApp());
}
- Print demo
final printer = getIt<PrintApi>();
printer.printDirectText(
printerModel: PrinterModel(
name: "Recipe Print",
ip: "192.168.1.13",
),
print: ReceiptModel.demo(),
);