PrintController class

State of the Print tab: the chosen template, the print settings and, when rows with real data were given, the rows to print.

Print settings (copies, used positions, paper) belong to one print only: they never change the stored template.

Inheritance

Constructors

PrintController({required PrintLibrary library, required PrintDataProvider dataProvider})

Properties

canPrint → bool
True when there is something to print.
no setter
copies → int
no setter
dataProvider → PrintDataProvider
final
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isPrinting → bool
True while the chosen template is shown with its print settings.
no setter
job → PrintJob?
no setter
library → PrintLibrary
final
paper → PaperFormat?
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sheetSkips → List<int>
Positions skipped on each sheet that will be printed (one entry per sheet). Rolls and single-page formats never skip positions.
no setter
template → PrintTemplate?
no setter

Methods

accepts(PrintTemplate template) → bool
Templates the current job can use.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addToJob(PrintJob more) → int
Adds the rows of more that are not in the job yet and returns how many were added. Without a job yet, it starts one.
chooseTemplate(PrintTemplate template) → void
clearJob() → void
closeTemplate() → void
Back to the template list.
dispose() → void
Discards any resources used by the object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
printSelected(BuildContext context) → Future<void>
Sends the print to the system print dialog.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeRow(String key) → void
Removes one row from the job.
request(BuildContext context, {bool preview = false, bool singleCell = false}) → PrintRequest
What the renderer needs for the chosen template.
saveSelected(BuildContext context) → Future<String?>
Saves the PDF where the user chooses, through the system save dialog.
setCopies(int value) → void
setPaper(String formatId) → void
setSkippedCells(int sheetIndex, int value) → void
Sets how many positions are already used at the start of sheet sheetIndex (0-based).
startJob(PrintJob job) → void
Starts printing job. A chosen template that cannot print its rows is dropped.
syncWithLibrary() → void
The templates were reloaded or changed: keep showing the stored version of the chosen one, or go back to the list if it was deleted.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited