fromMap static method
Gets a possible PrintJobSettings instance from a Map value.
Implementation
static PrintJobSettings? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = PrintJobSettings(
colorMode: PrintJobColorMode.fromNativeValue(map['colorMode']),
duplexMode: PrintJobDuplexMode.fromNativeValue(map['duplexMode']),
faxNumber: map['faxNumber'],
firstPage: map['firstPage'],
footerHeight: map['footerHeight'],
forceRenderingQuality: PrintJobRenderingQuality.fromNativeValue(
map['forceRenderingQuality']),
headerHeight: map['headerHeight'],
horizontalPagination:
PrintJobPaginationMode.fromNativeValue(map['horizontalPagination']),
jobDisposition:
PrintJobDisposition.fromNativeValue(map['jobDisposition']),
jobName: map['jobName'],
jobSavingURL:
map['jobSavingURL'] != null ? WebUri(map['jobSavingURL']) : null,
lastPage: map['lastPage'],
margins: MapEdgeInsets.fromMap(map['margins']?.cast<String, dynamic>()),
maximumContentHeight: map['maximumContentHeight'],
maximumContentWidth: map['maximumContentWidth'],
mediaSize:
PrintJobMediaSize.fromMap(map['mediaSize']?.cast<String, dynamic>()),
mustCollate: map['mustCollate'],
numberOfPages: map['numberOfPages'],
orientation: PrintJobOrientation.fromNativeValue(map['orientation']),
outputType: PrintJobOutputType.fromNativeValue(map['outputType']),
pageOrder: PrintJobPageOrder.fromNativeValue(map['pageOrder']),
pagesAcross: map['pagesAcross'],
pagesDown: map['pagesDown'],
paperName: map['paperName'],
resolution: PrintJobResolution.fromMap(
map['resolution']?.cast<String, dynamic>()),
scalingFactor: map['scalingFactor'],
time: map['time'],
verticalPagination:
PrintJobPaginationMode.fromNativeValue(map['verticalPagination']),
);
instance.animated = map['animated'];
instance.canSpawnSeparateThread = map['canSpawnSeparateThread'];
instance.copies = map['copies'];
instance.detailedErrorReporting = map['detailedErrorReporting'];
instance.handledByClient = map['handledByClient'];
instance.headerAndFooter = map['headerAndFooter'];
instance.isHorizontallyCentered = map['isHorizontallyCentered'];
instance.isVerticallyCentered = map['isVerticallyCentered'];
instance.showsNumberOfCopies = map['showsNumberOfCopies'];
instance.showsPageRange = map['showsPageRange'];
instance.showsPageSetupAccessory = map['showsPageSetupAccessory'];
instance.showsPaperOrientation = map['showsPaperOrientation'];
instance.showsPaperSelectionForLoadedPapers =
map['showsPaperSelectionForLoadedPapers'];
instance.showsPaperSize = map['showsPaperSize'];
instance.showsPreview = map['showsPreview'];
instance.showsPrintPanel = map['showsPrintPanel'];
instance.showsPrintSelection = map['showsPrintSelection'];
instance.showsProgressPanel = map['showsProgressPanel'];
instance.showsScaling = map['showsScaling'];
return instance;
}