toMap method

Map<String, dynamic> toMap({
  1. EnumMethod? enumMethod,
})

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "animated": animated,
    "canSpawnSeparateThread": canSpawnSeparateThread,
    "collate": collate,
    "colorMode": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => colorMode?.toNativeValue(),
      EnumMethod.value => colorMode?.toValue(),
      EnumMethod.name => colorMode?.name(),
    },
    "copies": copies,
    "detailedErrorReporting": detailedErrorReporting,
    "duplexMode": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => duplexMode?.toNativeValue(),
      EnumMethod.value => duplexMode?.toValue(),
      EnumMethod.name => duplexMode?.name(),
    },
    "faxNumber": faxNumber,
    "firstPage": firstPage,
    "footerHeight": footerHeight,
    "footerUri": footerUri,
    "forceRenderingQuality": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => forceRenderingQuality?.toNativeValue(),
      EnumMethod.value => forceRenderingQuality?.toValue(),
      EnumMethod.name => forceRenderingQuality?.name(),
    },
    "handledByClient": handledByClient,
    "headerAndFooter": headerAndFooter,
    "headerHeight": headerHeight,
    "headerTitle": headerTitle,
    "horizontalPagination": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => horizontalPagination?.toNativeValue(),
      EnumMethod.value => horizontalPagination?.toValue(),
      EnumMethod.name => horizontalPagination?.name(),
    },
    "isHorizontallyCentered": isHorizontallyCentered,
    "isVerticallyCentered": isVerticallyCentered,
    "jobDisposition": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => jobDisposition?.toNativeValue(),
      EnumMethod.value => jobDisposition?.toValue(),
      EnumMethod.name => jobDisposition?.name(),
    },
    "jobName": jobName,
    "jobSavingURL": jobSavingURL?.toString(),
    "lastPage": lastPage,
    "margins": margins?.toMap(),
    "maximumContentHeight": maximumContentHeight,
    "maximumContentWidth": maximumContentWidth,
    "mediaSize": mediaSize?.toMap(enumMethod: enumMethod),
    "mustCollate": mustCollate,
    "numberOfPages": numberOfPages,
    "orientation": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => orientation?.toNativeValue(),
      EnumMethod.value => orientation?.toValue(),
      EnumMethod.name => orientation?.name(),
    },
    "outputType": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => outputType?.toNativeValue(),
      EnumMethod.value => outputType?.toValue(),
      EnumMethod.name => outputType?.name(),
    },
    "pageHeight": pageHeight,
    "pageOrder": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => pageOrder?.toNativeValue(),
      EnumMethod.value => pageOrder?.toValue(),
      EnumMethod.name => pageOrder?.name(),
    },
    "pageRanges": pageRanges,
    "pageWidth": pageWidth,
    "pagesAcross": pagesAcross,
    "pagesDown": pagesDown,
    "pagesPerSide": pagesPerSide,
    "paperName": paperName,
    "printDialogKind": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => printDialogKind?.toNativeValue(),
      EnumMethod.value => printDialogKind?.toValue(),
      EnumMethod.name => printDialogKind?.name(),
    },
    "printerName": printerName,
    "resolution": resolution?.toMap(enumMethod: enumMethod),
    "scalingFactor": scalingFactor,
    "shouldPrintBackgrounds": shouldPrintBackgrounds,
    "shouldPrintHeaderAndFooter": shouldPrintHeaderAndFooter,
    "shouldPrintSelectionOnly": shouldPrintSelectionOnly,
    "showUI": showUI,
    "showsNumberOfCopies": showsNumberOfCopies,
    "showsPageRange": showsPageRange,
    "showsPageSetupAccessory": showsPageSetupAccessory,
    "showsPaperOrientation": showsPaperOrientation,
    "showsPaperSelectionForLoadedPapers": showsPaperSelectionForLoadedPapers,
    "showsPaperSize": showsPaperSize,
    "showsPreview": showsPreview,
    "showsPrintPanel": showsPrintPanel,
    "showsPrintSelection": showsPrintSelection,
    "showsProgressPanel": showsProgressPanel,
    "showsScaling": showsScaling,
    "time": time,
    "verticalPagination": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => verticalPagination?.toNativeValue(),
      EnumMethod.value => verticalPagination?.toValue(),
      EnumMethod.name => verticalPagination?.name(),
    },
  };
}