toWebOptions method

Map<String, dynamic> toWebOptions()

Converts the options to a map that can be passed to the web function call.


Map<String, dynamic> toWebOptions() {
  return <String, dynamic>{
    'flatten': flatten,
    'incremental': incremental,
    'excludeAnnotations': excludeAnnotations,
    'saveForPrinting': saveForPrinting,
    'outputFormat': outputFormat,
    'optimize': optimize,
    'includeComments': includeComments,
    'permissions': {
      'documentPermissions': permissions?.map((e) => ?? [],
      'userPassword': userPassword,
      'ownerPassword': ownerPassword,
    }..removeWhere((key, value) => value == null)
  }..removeWhere((key, value) =>
      value == null ||
      value is List && value.isEmpty ||
      value is Map && value.isEmpty);