toMap method

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

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "attributes": attributes?.toMap(enumMethod: enumMethod),
    "canSpawnSeparateThread": canSpawnSeparateThread,
    "copies": copies,
    "creationTime": creationTime,
    "currentPage": currentPage,
    "firstPage": firstPage,
    "isCopyingOperation": isCopyingOperation,
    "label": label,
    "lastPage": lastPage,
    "numberOfPages": numberOfPages,
    "pageOrder": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => pageOrder?.toNativeValue(),
      EnumMethod.value => pageOrder?.toValue(),
      EnumMethod.name => pageOrder?.name(),
    },
    "preferredRenderingQuality": switch (enumMethod ??
        EnumMethod.nativeValue) {
      EnumMethod.nativeValue => preferredRenderingQuality?.toNativeValue(),
      EnumMethod.value => preferredRenderingQuality?.toValue(),
      EnumMethod.name => preferredRenderingQuality?.name(),
    },
    "printer": printer?.toMap(enumMethod: enumMethod),
    "showsPrintPanel": showsPrintPanel,
    "showsProgressPanel": showsProgressPanel,
    "state": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => state?.toNativeValue(),
      EnumMethod.value => state?.toValue(),
      EnumMethod.name => state?.name(),
    },
  };
}