fromMap static method

PrintJobAttributes? fromMap(
  1. Map<String, dynamic>? map
)

Gets a possible PrintJobAttributes instance from a Map value.

Implementation

static PrintJobAttributes? fromMap(Map<String, dynamic>? map) {
  if (map == null) {
    return null;
  }
  final instance = PrintJobAttributes(
    colorMode: PrintJobColorMode.fromNativeValue(map['colorMode']),
    detailedErrorReporting: map['detailedErrorReporting'],
    duplex: PrintJobDuplexMode.fromNativeValue(map['duplex']),
    faxNumber: map['faxNumber'],
    footerHeight: map['footerHeight'],
    headerAndFooter: map['headerAndFooter'],
    headerHeight: map['headerHeight'],
    horizontalPagination:
        PrintJobPaginationMode.fromNativeValue(map['horizontalPagination']),
    isHorizontallyCentered: map['isHorizontallyCentered'],
    isSelectionOnly: map['isSelectionOnly'],
    isVerticallyCentered: map['isVerticallyCentered'],
    jobDisposition:
        PrintJobDisposition.fromNativeValue(map['jobDisposition']),
    jobSavingURL:
        map['jobSavingURL'] != null ? WebUri(map['jobSavingURL']) : null,
    localizedPaperName: map['localizedPaperName'],
    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'],
    orientation: PrintJobOrientation.fromNativeValue(map['orientation']),
    pagesAcross: map['pagesAcross'],
    pagesDown: map['pagesDown'],
    paperName: map['paperName'],
    paperRect:
        InAppWebViewRect.fromMap(map['paperRect']?.cast<String, dynamic>()),
    printableRect: InAppWebViewRect.fromMap(
        map['printableRect']?.cast<String, dynamic>()),
    resolution: PrintJobResolution.fromMap(
        map['resolution']?.cast<String, dynamic>()),
    scalingFactor: map['scalingFactor'],
    time: map['time'],
    verticalPagination:
        PrintJobPaginationMode.fromNativeValue(map['verticalPagination']),
  );
  return instance;
}