toMap method

Map<String, dynamic> toMap()

Returns a Map representation of the PdfConfiguration object. This is used to pass the configuration to the platform side.

Implementation

Map<String, dynamic> toMap() {
  return {
    'scrollDirection': scrollDirection?.name,
    'pageTransition': pageTransition?.name,
    'enableTextSelection': enableTextSelection,
    'disableAutosave': disableAutosave,
    'pageLayoutMode': pageLayoutMode?.name,
    'spreadFitting': spreadFitting?.name,
    'showPageLabels': showPageLabels,
    'startPage': startPage,
    'documentLabelEnabled': documentLabelEnabled,
    'firstPageAlwaysSingle': firstPageAlwaysSingle,
    'invertColors': invertColors,
    'password': password,
    'androidGrayScale': androidGrayScale,
    'inlineSearch': inlineSearch,
    'toolbarTitle': toolbarTitle,
    'showActionNavigationButtons': showActionNavigationButtons,
    'userInterfaceViewMode': userInterfaceViewMode?.name,
    'immersiveMode': immersiveMode,
    'appearanceMode': appearanceMode?.name,
    'settingsMenuItems': settingsMenuItems,
    'androidShowSearchAction': androidShowSearchAction,
    'androidShowOutlineAction': androidShowOutlineAction,
    'androidShowBookmarksAction': androidShowBookmarksAction,
    'androidEnableDocumentEditor': androidEnableDocumentEditor,
    'androidShowShareAction': androidShowShareAction,
    'androidShowPrintAction': androidShowPrintAction,
    'androidShowDocumentInfoView': androidShowDocumentInfoView,
    'androidDarkThemeResource': androidDarkThemeResource,
    'androidDefaultThemeResource': androidDefaultThemeResource,
    'iOSLeftBarButtonItems': iOSLeftBarButtonItems,
    'iOSRightBarButtonItems': iOSRightBarButtonItems,
    'iOSAllowToolbarTitleChange': iOSAllowToolbarTitleChange,
    'showThumbnailBar': showThumbnailBar?.name,
    'androidShowThumbnailGridAction': androidShowThumbnailGridAction,
    'enableAnnotationEditing': enableAnnotationEditing,
    'androidShowAnnotationListAction': androidShowAnnotationListAction,
    'enableInstantComments': enableInstantComments,
    'enableMeasurementTools': enableMeasurementTools,
    'enableMeasurementToolSnapping': measurementSnappingEnabled,
    'enableMagnifier': enableMagnifier,
    'measurementValueConfigurations':
        measurementValueConfigurations?.map((e) => e.toMap()).toList(),
    'toolbarItemGrouping': convertAnnotationToolsGrouping()
  }..removeWhere((key, value) => value == null);
}