print receipt

This commit is contained in:
efrilm
2025-11-06 18:15:54 +07:00
parent 896ea6c28c
commit bf7a5708f5
16 changed files with 1132 additions and 32 deletions
@@ -23,4 +23,21 @@ class Printer with _$Printer {
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
);
factory Printer.fromTest({
required String code,
required String name,
required String address,
required String paper,
required String type,
}) => Printer(
id: generateRandomNumber(),
code: code,
name: name,
address: address,
paper: paper,
type: type,
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
);
}
+1
View File
@@ -3,6 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:print_bluetooth_thermal/print_bluetooth_thermal.dart';
import '../../common/api/api_failure.dart';
import '../../common/function/app_function.dart';
part 'printer.freezed.dart';
@@ -10,4 +10,8 @@ abstract class IPrinterRepository {
Future<Either<PrinterFailure, Unit>> updatePrinter(Printer printer, int id);
Future<Either<PrinterFailure, Unit>> deletePrinter(int id);
Future<Either<PrinterFailure, Printer>> getPrinterByCode(String code);
Future<Either<PrinterFailure, bool>> printStruct(
Printer printer,
List<int> printValue,
);
}