Commit e10161af authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

add functionality for printer updating

parent b93aaaa6
......@@ -56,6 +56,17 @@ class Printer extends PrinterBase {
queue: map['queue'] != null ? PrintQueueTask.fromMap(map['queue']) : null,
);
PrinterBase get copyBase => PrinterBase(
coinOperated: coinOperated,
community: community,
description: description,
deviceId: deviceId,
hasA3: hasA3,
hostname: hostname,
ip: ip,
location: location,
mac: mac);
@override
Map<String, dynamic> get toMap => <String, dynamic>{
'id': id,
......
......@@ -134,36 +134,7 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> {
super.onTransition(transition);
}
void onUpdatePrinter(
int deviceId, {
String hostname,
String ip,
String community,
String mac,
String location,
String description,
bool hasA3,
bool coinOperated,
bool watchToner,
bool watchTray1,
bool watchTray2,
bool watchTray3,
int watchInterval,
}) {
add(UpdatePrinter(
deviceId,
PrinterBase(
hostname: hostname,
ip: ip,
community: community,
mac: mac,
location: location,
description: description,
deviceId: deviceId,
hasA3: hasA3,
coinOperated: coinOperated,
)));
}
void onUpdatePrinter(int deviceId, PrinterBase options) => add(UpdatePrinter(deviceId, options));
Future<void> _addPrinter(PrinterBase details) async {
_log.finer('_addPrinter: $details');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment