Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AStA
AStAPrint Admin Business Logic
Commits
e10161af
Commit
e10161af
authored
May 30, 2022
by
Leon Tappe
🔥
Browse files
add functionality for printer updating
parent
b93aaaa6
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/src/models/printer.dart
View file @
e10161af
...
...
@@ -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
,
...
...
lib/src/printers/printers_bloc.dart
View file @
e10161af
...
...
@@ -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
'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment